Bot Discord vous permettant de lire votre contenu musical Plex sur Discord. Tout comme Rythm. La configuration se fait dans un document .yaml...
Go to file
Joshua Arulsamy 360416bb02 Merge branch 'master' of github.com:jarulsamy/Plex-Bot 2022-08-03 16:45:12 -06:00
PlexBot Merge branch 'master' of github.com:jarulsamy/Plex-Bot 2022-08-03 16:45:12 -06:00
assets 📝 Overhaul docs 2020-08-09 15:24:15 -06:00
deploy 🎨 Switch to shell scripts for deployment 2020-08-10 02:16:11 -06:00
.flake8 Initial commit 2020-07-22 16:17:16 -06:00
.gitignore 🙈 Deployment script 2020-08-08 17:18:11 -06:00
.pre-commit-config.yaml Initial commit 2020-07-22 16:17:16 -06:00
Dockerfile 👥 Add label of maintainer 2020-08-14 20:57:03 -06:00
Jenkinsfile 🐛 Fix always skip push 2020-08-10 03:03:54 -06:00
LICENSE Initial commit 2020-07-22 16:17:16 -06:00
Makefile Makefile for dev and prod envs 2020-08-13 01:58:31 -06:00
README.md Added Lyrics in docker-compose.yml and slightly changed instructions 2021-11-28 20:59:45 +05:30
docker-compose.yml 🚀 Use docker pull instead of building repo 2020-08-09 15:24:50 -06:00
docker-compose_dev.yml 🐛 Fix auto restart on dev env 2020-08-13 02:47:54 -06:00
pyproject.toml Initial commit 2020-07-22 16:17:16 -06:00
requirements.txt 🐛 Bump discord version 2020-09-23 22:36:47 -06:00
sample-config.yaml Add lyrics command 2020-09-06 15:32:40 -06:00

README.md

Plex-Bot

Codacy Badge GPLv3 license docker pulls docker img size black badge

A Python-based Plex music bot for discord.

screenshot

Setup

Plex-Bot runs entirely in a Docker container. Ensure you have Docker and docker-compose installed according to the official Docker documentation.

  1. Create a new folder and cd into it:

    mkdir Plex-Bot
    cd Plex-Bot
    
  2. Make a docker-compose.yml file or use this sample:

    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 new config folder and create a config file like this::

    mkdir config
    cd config
    touch config.yaml
    
    # Create a file called config.yaml with the following contents
    
    root:
      log_level: "info"
    
    discord:
      prefix: "?"
      token: "<BOT_TOKEN>"
      log_level: "debug"
    
    plex:
      base_url: "<BASE_URL>"
      token: "<PLEX_TOKEN>"
      library_name: "<LIBRARY_NAME>"
      log_level: "debug"
    
    lyrics:
      token: "none" # Add your token here if you enable lyrics
    
  4. Create a Discord bot application:

    1. Go to the Discord developer portal, here.

    2. Log in or create an account

    3. Click New App

    4. Fill in App Name and anything else you'd like to include

    5. Click Create App This will provide you with your Client ID and Client Secret

    6. Click Create Bot User This will provide you with your bot Username and Token

    7. Fill in the bot token in config/config.yaml

  5. Get your plex token:

    • Refer to the official plex documentation.

    • Add it to config/config.yaml in the appropiate spot.

  6. Get your Lyrics Genius token (Optional):

    If you would like to enable the lyrics feature of the bot, you need to signup for a free GeniusLyrics account, here.

    After you make an account:

    1. Click New API Client

    2. Set the app website url to: https://github.com/jarulsamy/Plex-Bot

    3. Set the redirect url to: http://localhost

    4. Copy the Client Access Token and replace None with your token in config/config.yaml

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

  8. Start the service:

    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

General:
    kill [silent] - Halt the bot [silently].
    help - Print this help message.
    cleanup - Delete old messages from the bot.

Plex:
    play <SONG_NAME> - Play a song from the plex server.
    album <ALBUM_NAME> - Queue an entire album to play.
    playlist <PLAYLIST_NAME> - Queue an entire playlist to play.
    lyrics - Print the lyrics of the song (Requires Genius API)
    np - Print the current playing song.
    stop - Halt playback and leave vc.
    pause - Pause playback.
    resume - Resume playback.
    clear - Clear play queue.

[] - Optional args.