A Discord bot built for seamless Plex and Overseerr integration. It allows users to search your media library, view active streams, and request new media directly from Discord using modern slash commands.
- Library Integration: Search your Plex library with fuzzy matching and view TMDB posters.
- Stream Monitoring: View currently active Plex streams complete with progress bars and transcoding information.
- Media Requests: Search TMDB and request new movies or TV shows via Overseerr.
- Interactive TV Show Requests: When requesting a TV show, the bot actively prompts you to select which specific seasons to request.
- Admin Management: View pending requests and approve or deny them directly within Discord.
- Server Stats: Quickly check recently added media and overall server statistics.
/plex search <query>: Search your Plex library with fuzzy matching./plex playing: View active streams with progress bars and transcode info./plex recent: Show recently added media./plex stats: Display Plex server statistics.
/request search <query>: Search TMDB and request new media via Overseerr./request status: View the status of your personal requests./request queue: View all pending requests (Admin only)./request approve//request deny: Manage and moderate requests (Admin only).
- Python 3.11+
- Discord Bot Token
- Plex Server & Token
- Overseerr Server & API Key
-
Clone the repository and navigate to the project directory.
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install the package and its runtime dependencies:
python -m pip install . -
Copy the environment example file:
cp .env.example .env
Install development tooling for tests, linting, and type checking:
python -m pip install -e ".[dev]"| Variable | Required | Description |
|---|---|---|
BOT_TOKEN |
Yes | Your Discord bot token |
GUILD_IDS |
Yes | Comma-separated Discord server IDs |
PLEX_URL |
Yes | URL to your Plex server (e.g., http://your-host:32400) |
PLEX_TOKEN |
Yes | Your Plex authentication token |
OVERSEERR_URL |
Yes | URL to your Overseerr instance (e.g., http://your-host:5055) |
OVERSEERR_API_KEY |
Yes | Your Overseerr API key |
LOG_FORMAT |
No | text (default) for human-readable logs, or json for structured JSON-lines output with per-request IDs |
Locally:
python src/bot.py(Note: src/bot.py is a thin launcher that delegates to discord_plex.bot.main)
With Docker:
docker compose up -d --buildUsing as a Cog: To compose this repo into a larger bot, import the namespaced package:
from discord_plex import PlexCog
bot.add_cog(PlexCog(bot=bot))- Go to the Discord Developer Portal.
- Create a new application and add a bot in the "Bot" section.
- Enable Server Members Intent and Message Content Intent under Privileged Gateway Intents.
- Copy the bot token and add it to your
.envfile. - Go to OAuth2 > URL Generator.
- Select scopes:
bot,applications.commands. - Select permissions:
Send Messages,Read Message History,Use Slash Commands,Embed Links,Attach Files. - Use the generated URL to invite the bot to your server.
- Plex Token: In Plex, go to Settings > Account > Authorized Devices, or extract it via your browser's developer tools.
- Overseerr API Key: In Overseerr, go to Settings > General > API Key.
- Use the
/plexcommands to explore your current library and monitor server activity. - Use the
/requestcommands to search for new content. If requesting a TV show, click the interactive buttons to specify which seasons you want. - Server administrators can use
/request queueand the approve/deny commands to manage inbound Overseerr requests without leaving Discord.
Tests use pytest with pytest-asyncio (asyncio_mode = "auto"). All tests are mocked (no real API calls).
# Install developer tooling if you have not already
python -m pip install -e ".[dev]"
# Run tests locally
python -m pytest -q
# Run tests in Docker
docker build --build-arg PYTHON_VERSION=3.13 -f Dockerfile.test -t discord-plex-test .
docker run --rm discord-plex-test python -m pytest -q
# Run linting and type checks in Docker
docker run --rm discord-plex-test sh -lc 'ruff check src tests && ruff format --check src tests && pyright'
# Smoke-test another supported version
docker build --build-arg PYTHON_VERSION=3.11 -f Dockerfile.test -t discord-plex-test:3.11 .
docker run --rm discord-plex-test:3.11 python -m pytest -qruff check src tests
ruff format --check src tests
pyrightTests run automatically on push/PR to main via GitHub Actions. CI runs pytest across Python 3.11-3.14, builds a Docker smoke test image, and only pushes the release image on direct pushes after both checks pass.
MIT License - see LICENSE for details.