# Configuration

URL: https://zerodev.ca/docs/product-panel/configuration

> Every option in productpanel.json5 and productpanel-lang.json5.



Product Panel has two files in AthenaBot's `configuration/` folder:

| File                      | What it holds                              |
| ------------------------- | ------------------------------------------ |
| `productpanel.json5`      | License, panels, products and permissions. |
| `productpanel-lang.json5` | The panel messages and every reply.        |

Restart AthenaBot after editing either file.

## productpanel.json5

```json5 title="configuration/productpanel.json5"
{
  config: {
    LICENSE_KEY: "",
    always_use_web_api_downloads: false,
    panel_linking: {
      panel1: {
        type: "SELECT_MENU",
        product1: {
          role: "000000000000000000",
          name: "Product 1",
          emoji: "%custom_emoji_27%",
        },
      },
      panel2: {
        type: "BUTTON",
        product1: {
          role: "000000000000000000",
          name: "Product 1",
          color: "gray",
          emoji: "%custom_emoji_27%",
        },
      },
    },
    permissions: {
      productpanel_command: "everyone",
      panel_button_event: "everyone",
      panel_sm_event: "everyone",
    },
  },
}
```

| Option                         | What it does                                                                                                                                                             |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `LICENSE_KEY`                  | Your Product Panel license key.                                                                                                                                          |
| `always_use_web_api_downloads` | `true` sends every download as a link instead of an attachment. Zips over 10 MB are always sent as a link. See [Web Downloads](/docs/product-panel/usage#web-downloads). |
| `panel_linking`                | Your panels. Each key, such as `panel1`, is a panel ID.                                                                                                                  |

### Panels

Each panel has a `type` and one entry per product. The panel ID is what you pick in `/productpanel panel`, and it must also exist under `panels` in the lang file.

| Option | What it does                                                          |
| ------ | --------------------------------------------------------------------- |
| `type` | `SELECT_MENU` for a dropdown, or `BUTTON` for one button per product. |

A button panel shows up to 25 products in rows of 5. A select menu also shows up to 25. Use more panels if you have more products.

### Products

Each key under a panel, such as `product1`, is a product ID. It is also the name of the product's folder and of the zip members receive.

| Option  | What it does                                                                                       |
| ------- | -------------------------------------------------------------------------------------------------- |
| `name`  | The button or menu label.                                                                          |
| `emoji` | Optional. A custom emoji, as `%custom_emoji_<id>%`.                                                |
| `color` | Button panels only. `gray`, `blue`, `green` or `red`. Defaults to blue.                            |
| `url`   | Optional. Sends this link instead of a zip, for files hosted elsewhere.                            |
| `role`  | Optional. Only members with this role can download it. Others get the `permission_denied` message. |

### Permissions

Each value is a permission level from `configuration/permission.json5`.

| Option                 | Controls                                                           |
| ---------------------- | ------------------------------------------------------------------ |
| `productpanel_command` | Who can run `/productpanel panel`. Set this to `admin` or similar. |
| `panel_button_event`   | Who can use buttons on button panels.                              |
| `panel_sm_event`       | Who can use the menu on select menu panels.                        |

## productpanel-lang.json5

Messages are built with AthenaBot's components format. Each one is a list of `container` components holding `text`, `separator` and `section` parts. `%primary_color%` uses your AthenaBot accent colour, and `%custom_emoji_<id>%` uses any AthenaBot emoji.

### Panels

`panels` holds the message shown above each panel's buttons or menu. Add one entry for every panel ID in `panel_linking`.

```json5
panels: {
  panel1: {
    components: [
      {
        type: "container",
        accentColor: "%primary_color%",
        components: [
          { type: "text", content: "# Downloads\n\nPick a product to get the latest files." },
        ],
      },
    ],
  },
},
```

### Replies

| Key                                   | Shown when                                      | Placeholders                                                               |
| ------------------------------------- | ----------------------------------------------- | -------------------------------------------------------------------------- |
| `embed.panel_sent`                    | A panel is posted.                              | `%panel%`, `%channel%`                                                     |
| `embed.preparing_download`            | The zip is being made. Only the member sees it. | `%product%`                                                                |
| `embed.direct_download_ready`         | The zip is attached.                            | `%product%`                                                                |
| `embed.web_download_ready`            | A download is sent as a link.                   | `%product%`, `%download_url%`                                              |
| `embed.permission_denied`             | The member does not have the product's `role`.  | `%product%`                                                                |
| `embed.product_not_found`             | The product's folder is missing or empty.       | `%product%`                                                                |
| `embed.error_message`                 | Something went wrong.                           | `%message%`                                                                |
| `embed.download_log`                  | Posted in `productPanel-logs`.                  | `%product%`, `%panel%`, `%user_mention%`, `%user_id%`, `%download_method%` |
| `messages.select_product_placeholder` | The text in an empty select menu.               |                                                                            |

Set `ephemeral: true` on a reply to show it only to the member.
