A Discord bot that extracts and displays metadata from AI-generated images using the Unstable Reader library. When someone posts an image, the bot adds a 🔍 reaction - click it to see the prompt and metadata!
- Discord Bot: Automatically adds reactions to images for on-demand metadata extraction
- API: Provides an endpoint to extract metadata via HTTP POST requests
- Configurable: Option to auto-star images for Carl-bot starboard integration
This project uses uv - a modern Python package manager that handles Python versions and dependencies without affecting your system Python. Think of it like conda but for 2025.
-
Install uv:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Clone the repository:
git clone https://github.com/markuryy/unstable-reader-bot cd unstable-reader-bot -
Install dependencies:
uv sync
This automatically downloads Python 3.12 and creates an isolated environment.
-
Configure the bot:
copy .env.example .env
Edit
.envand replaceyour_actual_bot_token_herewith your Discord bot token. -
Run the bot:
uv run python discord_bot.py
-
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh -
Clone the repository:
git clone https://github.com/markuryy/unstable-reader-bot cd unstable-reader-bot -
Install dependencies:
uv sync
-
Configure the bot:
cp .env.example .env
Edit
.envand add your Discord bot token. -
Run the bot:
uv run python discord_bot.py
- Go to Discord Developer Portal
- Click "New Application" (top right)
- Name your bot (e.g., "Unstable Reader Bot")
- Click "Create"
- Go to "Bot" section (left sidebar)
- Click "Reset Token" or "Add Bot"
- Click "Copy" under TOKEN - save this for your
.envfile!
Under "Privileged Gateway Intents", enable:
- MESSAGE CONTENT INTENT
- SERVER MEMBERS INTENT
Save changes.
-
Go to "OAuth2" → "URL Generator" (left sidebar)
-
Under "Scopes", check:
bot
-
Under "Bot Permissions", select:
Read Message HistoryUse External EmojisAdd reactions
-
Copy the generated URL at the bottom
-
Open URL in browser
-
Select your server
-
Click "Authorize"
The bot will appear offline until you run it!
The bot can automatically add ⭐ reactions for Carl-bot starboard integration. To disable:
- Open
discord_bot.py - Find
ADD_STARS = Truenear the top - Change to
ADD_STARS = False - Restart the bot
!exclude: Exclude current channel from image analysis!include: Include current channel in image analysis
- Bot adds 🔍 reaction to new images
- Click the reaction to receive metadata via DM
- If enabled, also adds ⭐ for starboard
The bot also runs a local API at http://localhost:8000:
curl -X POST "http://localhost:8000/extract-metadata/" -F "file=@image.jpg"To update the bot with latest changes:
git pull && uv sync- No pip needed: uv handles everything - don't install pip or use pip commands
- Python version issues: uv automatically uses Python 3.12, regardless of your system Python
- Bot appears offline: Make sure you're running
uv run python discord_bot.py - No reactions on old images: Bot only reacts to images posted while it's running
- Works with ComfyUI images (better with ComfyUI Image Metadata extension)
- Virtual environment is just a folder with dependencies - not a container or VM
- Can run continuously or as a system service
MIT License
- Markury - with assistance from AI tools (Claude & ChatGPT)