PlexBot is a powerful, multifaceted Discord bot designed to be the central hub for managing your entire media server ecosystem. It seamlessly integrates with Plex, Docker, Real-Debrid, and the *Arr suite (Sonarr, Radarr) to bring server management, status monitoring, and user administration right into your Discord server.
PlexBot is packed with features to streamline your media server management:
- Container Status: Quickly check the status of your Plex container (
/plexstatus). - Container Restarts: Restart the Plex container or the entire Docker stack directly from Discord (
/restartplex,/restartcontainers). - System Health: Monitor the health of the bot and its services with a dedicated health check command.
- Library Access Control: Allow users to select which Plex libraries they are interested in, helping you manage access and notifications (
/plexaccess).
- Account Status: Check your Real-Debrid account details, including premium status and expiration (
/realdebrid). - Expiry Notifications: Automatically receive a warning in a designated channel when your Real-Debrid subscription is about to expire.
- Automated Notifications: (Implicit) The bot is structured to receive webhook notifications from Sonarr, Radarr, and Overseerr to report on new media, requests, and other events.
- Multi-Instance Support: Configure multiple Sonarr instances (e.g., for 4K content or anime) in the
config.jsonfile.
- Automated Role Assignment: Greet new users and automatically assign them a specific role.
- Easy Invite System: Integrates with services like Wizarr to provide and manage user invites.
Follow these steps to get PlexBot up and running on your server.
- Python 3.10+
- Docker and Docker Compose
- A Discord Bot application created on the Discord Developer Portal
Clone the repository to your local machine:
git clone https://github.com/your-username/Plexbot.git
cd PlexbotIt is highly recommended to use a Python virtual environment.
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`Install the required dependencies:
pip install -r requirements.txtPlexBot uses two primary configuration files. Sample files are provided to get you started.
A. Environment Variables (.env)
Copy the sample file:
cp sample.env .envNow, edit the .env file and fill in your details. This file holds your secret keys and basic connection info. See the comments in the sample.env file for guidance on each variable.
B. JSON Configuration (config.json)
Copy the sample configuration:
cp config.json.sample config.jsonEdit config.json to configure the bot's features, like enabling/disabling modules, setting up Sonarr instances, and mapping users.
Once configured, you can start the bot with:
python bot.pyFor a more robust setup, it is recommended to run the bot using the provided docker-compose.yml file after building the Docker image.
Here are some of the primary commands you can use with PlexBot:
/plexstatus- Checks the status of the Plex Docker container./restartplex- Initiates a restart of the Plex container./restartcontainers- Restarts the entire container stack defined in your environment file./realdebrid- Fetches and displays your Real-Debrid account status./plexaccess- Allows users to self-select the Plex libraries they're interested in.
This project is licensed under the MIT License. See the LICENSE file for details.