Usage
Build a panel, add your files and post it in Discord.
1. Add a Panel
In configuration/productpanel.json5, add a panel under panel_linking with one entry per product:
panel_linking: {
downloads: {
type: "BUTTON",
plugin: {
name: "My Plugin",
color: "blue",
emoji: "%custom_emoji_27%",
},
resourcepack: {
name: "Resource Pack",
color: "gray",
},
},
},Then add a message for it under panels in productpanel-lang.json5, using the same ID:
panels: {
downloads: {
components: [
{
type: "container",
accentColor: "%primary_color%",
components: [{ type: "text", content: "# Downloads\n\nPick a product below." }],
},
],
},
},2. Add the Files
Restart AthenaBot. It creates a folder for every product:
configuration/
ProductPanel/
downloads/
plugin/
resourcepack/Put each product's files in its folder. When someone downloads, AthenaBot zips the whole folder and sends it as <product>.zip. Replace the files at any time. The next download uses the new ones, with no restart.
Zips up to 10 MB are attached in Discord. Bigger ones are sent as a download link, see Web Downloads. To host a file somewhere else instead, such as GitHub Releases, give the product a url and members get a button to that link.
3. Post the Panel
Run /productpanel panel and pick:
| Option | What to enter |
|---|---|
panel | The panel ID. It autocompletes. |
channel | Where to post it. |
The panel keeps working after restarts, since every button points at the panel and product IDs in your config. If you change a panel, post it again and delete the old one.
What Members See
- They press a button or pick from the menu.
- A private "Preparing Download" message appears.
- It changes to "Download Ready" with the zip attached, or with a download button for web downloads.
Every download is logged in productPanel-logs with the member, product, panel and method.
Limiting Who Can Download
Give a product a role and only members with that role can download it. Everyone else gets an "Access Denied" message that only they can see.
plugin: {
name: "My Plugin",
role: "123456789012345678",
},Products without a role can be downloaded by anyone who can use the panel. To hide a whole panel, post it in a channel only buyers can see, or raise panel_button_event and panel_sm_event to a permission level in configuration/permission.json5.
Web Downloads
A web download sends a one-time link instead of an attachment. It is used when:
- the zip is bigger than 10 MB, or
always_use_web_api_downloadsistrue.
The link is served by AthenaBot's web_api plugin at /api/productpanel/download/<token>. Each link is random, works for one hour, and is then deleted with its zip. Links are lost if AthenaBot restarts.
Members need to reach the web_api plugin from their browser. It listens on port 3111 by default:
- Point a domain at your server and put a reverse proxy in front of port
3111:
Caddy gets and renews HTTPS certificates on its own. Add this to your Caddyfile and reload Caddy.
downloads.example.com {
reverse_proxy 127.0.0.1:3111
}sudo systemctl reload caddy- Set
base_ipinconfiguration/web_api.json5tohttps://downloads.example.com. - Restart AthenaBot.
Without a domain, set base_ip to your server's IP and port, such as 203.0.113.10:3111, and open that port in your firewall. Links will use plain HTTP.
Troubleshooting
| Problem | Fix |
|---|---|
| "Product Not Found" | The product's folder is missing or empty. Check the folder name matches the product ID. Restart to recreate missing folders. |
| "Access Denied" | The member does not have the product's role. |
| A download link does not open | base_ip in web_api.json5 is wrong, or port 3111 is not reachable. |
| "This download link has expired" | Links last one hour and do not survive a restart. Download again. |
| The panel ID does not autocomplete | It is missing under panels in productpanel-lang.json5. |
| Buttons are missing | A button panel shows 25 products at most. Split them across panels. |
| Nothing happens on click | The member's permission level is below panel_button_event or panel_sm_event. |