Skip to main content

Documentation 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.

The marketplace bot is a Python Discord bot built with 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, or remove to interact with the bot
    • A private channel for file storage — the bot uploads .zip, .json, and .blend files to this channel and uses Discord’s CDN URL as the download link
  • A Discord bot application created in the Discord Developer Portal with the Message Content Intent enabled (required for the bot to read message text)
  • git installed and access to a remote repository with push credentials configured

Installation

1

Clone the repository

git clone https://github.com/joshuaKnauber/serpens_addon_market.git
cd serpens_addon_market
2

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.
pip install discord.py python-dotenv
3

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
DISCORD_TOKEN=your_discord_bot_token_here
4

Configure channel IDs in serpens_bot.py

The bot has three Discord channel IDs hardcoded directly in 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
if message.channel.id in [767853772562366514, 768053288989360128]:
Replace 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
channel = client.get_channel(785132940278366260)
Replace 785132940278366260 with the ID of your private file storage channel.
5

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:
addons.json
{"addons": []}
snippets.json
{"snippets": []}
packages.json
{"packages": []}
Each file is updated in place whenever a user completes an upload, update, or removal interaction.
6

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:
serpens_bot.py
os.system("git add -A")
os.system("git commit -m\"Serverlog\"")
os.system("git pull")
os.system("git push")
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.

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 .json files to the private storage channel
  • Message Content Intent — must be enabled under Privileged Gateway Intents in the Discord Developer Portal; without it, message.content will be empty and the bot cannot read any commands
The original bot has all three channel IDs hardcoded in serpens_bot.py. If you skip Step 4, the bot will attempt to post files to someone else’s Discord server and will only respond to messages in channels that don’t exist in your server. Always update all three IDs before running your instance.
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.

Build docs developers (and LLMs) love