# Modmail

<figure><img src="https://4022767025-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk9rByha0j0DRgblu3Nao%2Fuploads%2FlcHPeViNHPPtQD7i8MHq%2FScreenshot_163.png?alt=media&#x26;token=49fb9e45-89a3-4157-ac3a-3e8603e89f9f" alt=""><figcaption></figcaption></figure>

### Enabling Modmail

1. **Open Your Workspace**\
   Log in to the Panora Dashboard and select your workspace. Navigate to **Discord → Modmail** in the sidebar.
2. **Enable Modmail**\
   Go to the **Settings** tab, click **Configure**, and toggle **Enable Modmail** to activate Modmail for your server.
3. **Configure Modmail Settings**\
   Assign your **Staff Role**, optional **Admin Role**, **Ticket Category**, **Logs Channel**, and enable or disable reply commands.
4. **Deploy Modmail**\
   Once enabled, users can DM your bot to automatically create a private support thread.

***

### Configuration Breakdown

| Field               | Type    | Description                                      | Example / Default |
| ------------------- | ------- | ------------------------------------------------ | ----------------- |
| **Enabled**         | boolean | Whether Modmail is active                        | `false`           |
| **Staff Role**      | string  | Role with permission to view/respond to threads  | `@Support Team`   |
| **Admin Role**      | string  | Optional role with full access to all threads    | `@Management`     |
| **Parent Category** | string  | Discord category where threads are created       | `modmail-threads` |
| **Logs Channel**    | string  | Channel for Modmail logs (opened/closed threads) | `#modmail-logs`   |
| **Reply Command**   | boolean | Allow `!r` or `!reply` commands in threads       | `true`            |

***

### Modmail Flow

1. **User Opens Ticket:** A user DMs the bot.
2. **Thread Created:** A channel is automatically created in the Modmail category.
3. **Staff Handles Ticket:** Staff respond via reply commands or typing directly in the thread. Threads can be claimed or left unclaimed.
4. **Closing & Logs:** After resolution, staff close the thread. A transcript is automatically generated and sent to the logs channel. Thread metadata is saved for audit and history.

***

### Example Flow

**Scenario:**

* User `@prrent` DMs the bot:

  > “Hi, I am missing my rank.”
* They select the server from a dropdown.
* Panora creates a channel: `#modmail-prrent`
* Staff `@prrent` claims the thread and replies using `!r`.
* After the issue is resolved, staff click **Close Thread**.
* Transcript is sent to `#modmail-logs`.

***

### Permissions & Error Handling

* **Role-Gated Access:** Only assigned staff/admin roles can view threads.
* **Direct Messages:** Users must have DMs open to initiate Modmail.
* **Thread Tracking:** Full metadata and message history is stored for each thread.
* **Error Handling:** If DMs are blocked or configurations are invalid, Panora gracefully handles failures without breaking the bot.
