Product Panel/Configuration

Configuration

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

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

FileWhat it holds
productpanel.json5License, panels, products and permissions.
productpanel-lang.json5The panel messages and every reply.

Restart AthenaBot after editing either file.

productpanel.json5

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",
    },
  },
}
OptionWhat it does
LICENSE_KEYYour Product Panel license key.
always_use_web_api_downloadstrue sends every download as a link instead of an attachment. Zips over 10 MB are always sent as a link. See Web Downloads.
panel_linkingYour 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.

OptionWhat it does
typeSELECT_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.

OptionWhat it does
nameThe button or menu label.
emojiOptional. A custom emoji, as %custom_emoji_<id>%.
colorButton panels only. gray, blue, green or red. Defaults to blue.
urlOptional. Sends this link instead of a zip, for files hosted elsewhere.
roleOptional. 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.

OptionControls
productpanel_commandWho can run /productpanel panel. Set this to admin or similar.
panel_button_eventWho can use buttons on button panels.
panel_sm_eventWho 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.

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

Replies

KeyShown whenPlaceholders
embed.panel_sentA panel is posted.%panel%, %channel%
embed.preparing_downloadThe zip is being made. Only the member sees it.%product%
embed.direct_download_readyThe zip is attached.%product%
embed.web_download_readyA download is sent as a link.%product%, %download_url%
embed.permission_deniedThe member does not have the product's role.%product%
embed.product_not_foundThe product's folder is missing or empty.%product%
embed.error_messageSomething went wrong.%message%
embed.download_logPosted in productPanel-logs.%product%, %panel%, %user_mention%, %user_id%, %download_method%
messages.select_product_placeholderThe text in an empty select menu.

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