diff --git a/README.md b/README.md index e694d04..4caba35 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,113 @@ # Plex-Bot +[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](http://perso.crans.org/besson/LICENSE.html) +![docker pulls](https://img.shields.io/docker/pulls/jarulsamy/plex-bot) +![docker img size](https://img.shields.io/docker/image-size/jarulsamy/plex-bot) +Code style: black + A Python-based Plex music bot for discord. +![screenshot](assets/screenshot.png) + ## Setup Plex-Bot runs entirely in a Docker container. Ensure you have Docker and docker-compose installed according to the official Docker [documentation](https://docs.docker.com/get-docker/). -1. Clone the repository and `cd` into it: +1. Create a new folder and `cd` into it: ``` -$ git clone https://github.com/jarulsamy/Plex-Bot +$ mkdir Plex-Bot $ cd Plex-Bot ``` -2. Create a configuration folder: +2. Make a `docker-compose.yml` file or use this sample: -Create a new `config` folder and copy the sample config file into it: +```yml +version: "3" +services: + plex-bot: + container_name: "PlexBot" + image: jarulsamy/plex-bot:latest + environment: + - PUID=1000 + - PGID=1000 + - TZ=America/Denver + # Required dir for configuration files + volumes: + - "./config:/config:ro" + restart: "unless-stopped" +``` + +3. Create a configuration folder: + +Create a new `config` folder and create a config file like this: ``` $ mkdir config -$ cp sample-config.yaml config/config.yaml +$ cd config ``` -3. Create a Discord bot application: +```yml +# Create a file called config.yaml with the following contents - 1. Go to the Discord developer portal, [here](https://discord.com/developers/applications). +root: + log_level: "info" - 2. Log in or create an account +discord: + prefix: "?" + token: "" + log_level: "debug" - 3. Click New App +plex: + base_url: "" + token: "" + library_name: "" + log_level: "debug" +``` - 4. Fill in App Name and anything else you'd like to include +4. Create a Discord bot application: - 5. Click Create App + * Go to the Discord developer portal, [here](https://discord.com/developers/applications). + + * Log in or create an account + + * Click New App + + * Fill in App Name and anything else you'd like to include + + * Click Create App This will provide you with your Client ID and Client Secret - 6. Click Create Bot User + * Click Create Bot User This will provide you with your bot Username and Token - 7. Fill in all the necessary numbers in `config/config.yaml` + * Fill in the bot token in `config/config.yaml` -4. Get your plex token: +5. Get your plex token: - Refer to the official [plex documentation](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/). + * Refer to the official [plex documentation](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/). - Add it to `config/config.yaml` in the appropiate spot. + * Add it to `config/config.yaml` in the appropiate spot. -5. Start the service: +6. Customize remaining settings + + Set any remaining settings in the config file that you would like. Such as music library, and base url of the Plex server. + +7. Start the service: ``` -$ docker-compose up --build +$ docker-compose up -d +``` + +## Logs + +You can view the logs with the following command + +``` +$ docker-compose logs -f CONTAINER_NAME_OR_ID + +# For example +$ docker-compose logs -f PlexBot ``` ## Usage diff --git a/assets/screenshot.png b/assets/screenshot.png new file mode 100644 index 0000000..5dd93cc Binary files /dev/null and b/assets/screenshot.png differ diff --git a/docker-compose.yml b/docker-compose.yml index 50a4c7f..0e17d76 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: plex-bot: container_name: "PlexBot" - build: . + image: jarulsamy/plex-bot:latest environment: - PUID=1000 - PGID=1000 @@ -10,4 +10,4 @@ services: # Required dir for configuration files volumes: - "./config:/config:ro" - restart: "no" + restart: "unless-stopped"