The marketplace bot is a Python Discord bot built withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/joshuaKnauber/serpens_addon_market/llms.txt
Use this file to discover all available pages before exploring further.
discord.py and python-dotenv. It listens for messages in designated channels and guides community members through uploading, updating, and removing addons, snippets, and packages via a conversational flow. Running your own instance requires a Discord bot token, a configured server with the appropriate channels, and the three JSON data files the bot reads and writes to persist the marketplace catalog.
The bot is built with
discord.Client() — not commands.Bot. This means there are no prefix-based slash commands. All interaction is handled through the on_message event: the bot reads every message in its configured channels and drives the upload, update, and remove flows entirely through plain text messages.Prerequisites
Before you begin, make sure you have the following:- Python 3.x installed on your system
- A Discord server with at minimum:
- A public channel for commands — this is where users type
upload,update, orremoveto interact with the bot - A private channel for file storage — the bot uploads
.zip,.json, and.blendfiles to this channel and uses Discord’s CDN URL as the download link
- A public channel for commands — this is where users type
- A Discord bot application created in the Discord Developer Portal with the Message Content Intent enabled (required for the bot to read message text)
gitinstalled and access to a remote repository with push credentials configured
Installation
Install Python dependencies
The bot depends on two packages:
discord.py for the Discord API and python-dotenv for loading the bot token from a .env file.Create the .env file
Create a
.env file in the repository root and add your Discord bot token. The bot loads this at startup via load_dotenv() and reads it with os.getenv("DISCORD_TOKEN")..env
Configure channel IDs in serpens_bot.py
The bot has three Discord channel IDs hardcoded directly in Replace Replace
serpens_bot.py. You must replace all three with the channel IDs from your own server.Interaction channels — the channels where users type commands. Update the list inside the on_message event handler:serpens_bot.py
767853772562366514 and 768053288989360128 with the IDs of the channel(s) in your server where you want the bot to respond.File storage channel — the private channel the bot uses to host uploaded files. Update this ID in both the save_file and save_snippet functions:serpens_bot.py
785132940278366260 with the ID of your private file storage channel.Initialize the data files
The bot reads from and writes to three JSON files in the repository root. These files must exist before the bot starts. If you are starting fresh, create them with empty root arrays:Each file is updated in place whenever a user completes an upload, update, or removal interaction.
addons.json
snippets.json
packages.json
Configure git for auto-push
After processing every Discord message, the bot automatically stages, commits, pulls from remote, and pushes all changes to the repository:Make sure the repository has a remote configured and that the user running the bot process has push access — either via SSH keys or cached credentials. Without this, the auto-sync will fail silently.
serpens_bot.py
Discord Bot Permissions
When adding the bot to your server, grant it the following permissions:- Read Messages / View Channels — to see messages in the configured channels
- Send Messages — to respond to users throughout the conversational upload flow
- Manage Messages — to delete user messages after processing via
message.delete(), keeping channels clean - Attach Files — to send uploaded
.zip,.blend, and.jsonfiles to the private storage channel - Message Content Intent — must be enabled under Privileged Gateway Intents in the Discord Developer Portal; without it,
message.contentwill be empty and the bot cannot read any commands
The bot uses
os.getenv("DISCORD_TOKEN") loaded via python-dotenv. The .env file must be present in the working directory from which you launch the bot — not just in the repository root if those differ. When using run.sh, the script cds into the repository directory first, so the .env file in the repository root is the correct location.