Compare commits

...

80 Commits

Author SHA1 Message Date
Joshua Arulsamy
360416bb02 Merge branch 'master' of github.com:jarulsamy/Plex-Bot 2022-08-03 16:45:12 -06:00
Carsten Burgard
ccee843a36 added functionality to inspect current queue and skip multiple tracks at once 2022-08-03 22:40:54 +00:00
Carsten Burgard
90c40fb0d6 rewrote looping 2022-04-15 16:11:44 +02:00
Carsten Burgard
8b90fb8e34 added debug message 2022-04-15 16:06:22 +02:00
Carsten Burgard
60ef54d8e4 python version screwup workaround 2022-04-15 15:53:30 +02:00
Carsten Burgard
280cbaed92 added basic functionality for looping queues 2022-04-15 15:41:50 +02:00
Carsten Burgard
2f17494ebd added documentation 2022-04-15 15:07:17 +02:00
Carsten Burgard
ed9e677108 playlist shuffling implemented 2022-04-15 15:05:37 +02:00
Carsten Burgard
aa51cc4301 bugfix for missing thumbnail 2022-04-15 14:27:45 +02:00
Carsten Burgard
069d88fd1e implemented looping of tracks 2022-04-15 12:43:55 +02:00
Carsten Burgard
15b7e0f50e catching a few exceptions and handling them accordingly 2022-04-15 12:42:49 +02:00
Carsten Burgard
04da5dfd42 added functionality to inspect current queue and skip multiple tracks at once 2022-04-15 11:53:43 +02:00
Joshua Arulsamy
19360e3101
Merge pull request #27 from cburgard/playlist-magic
Added command to show available playlists
2022-02-22 07:30:23 -07:00
Carsten Burgard
52099fa794 added option to show available playlists 2022-02-13 13:12:35 +01:00
Carsten Burgard
139ce07d24 fix bug related to empty playlists 2022-02-13 13:10:59 +01:00
Carsten Burgard
5f9c83b75e added documentation for missing option 2022-02-13 13:03:07 +01:00
Carsten Burgard
f8e5af87b6 allow executing outside of docker env by checking if user is root user for config path 2022-02-13 12:04:34 +01:00
Carsten Burgard
a45ccb657e make dependency on lyricsgenius optional by moving import 2022-02-13 12:02:49 +01:00
Carsten Burgard
bcbce98d91 allow lyrics section in yml file to be missing 2022-02-13 12:02:15 +01:00
Joshua Arulsamy
6521e7e26c
Merge pull request #25 from Raventhicc/patch-1
Added Lyrics in docker-compose.yml and slightly changed instructions
2021-11-28 14:54:32 -07:00
Raventric
add1a1af0d
Added Lyrics in docker-compose.yml and slightly changed instructions
This was just done to make it easier for people to understand since some people stumbled on this part.
2021-11-28 20:59:45 +05:30
Joshua Arulsamy
8f05f5e27f
Merge pull request #19 from profesaurus/feature_playlists
Feature playlists
2021-05-30 01:33:09 -06:00
profesaurus
eeb430c016 Fixed even more Codacy Static Code Analysis issues. 2021-05-27 15:39:50 -07:00
profesaurus
1ffa5a7229 Attempt to fix additional Codacy Static Code Analysis issues. 2021-05-27 15:35:34 -07:00
profesaurus
f4cd675502 Attempting to fix the Codacy Static Code Analysis issues. 2021-05-27 14:33:24 -07:00
profesaurus
921dfc02b8 Updated README.md to include the playlist command. Added the playlist command to bot.py comments. 2021-05-27 08:11:02 -07:00
profesaurus
9fb091e9e1 Added the ability to play a playlist with a new "playlist" command.
Ex. ?playlist MyPlaylistName
2021-05-26 09:28:57 -07:00
Joshua Arulsamy
efdd604d65
Merge pull request #14 from jarulsamy/hotfix
Hotfix
2020-09-23 22:46:04 -06:00
Joshua Arulsamy
7d6060ed15 🔖 Bump version 2020-09-23 22:40:20 -06:00
Joshua Arulsamy
d6f5174d20 🐛 Bump discord version
Remedies a seemingly random socketio error:

```
    future: <Task finished coro=<VoiceClient._create_socket() done, defined at /usr/local/lib/python3.7/site-packages/discord/voice_client.py:172>
    exception=gaierror(-2, 'Name or service not known')>

    Traceback (most recent call last):
    File "/usr/local/lib/python3.7/site-packages/discord/voice_client.py", line 191, in _create_socket
    self.endpoint_ip = socket.gethostbyname(self.endpoint) socket.gaierror: [Errno -2] Name or service not known
```
2020-09-23 22:36:47 -06:00
Joshua Arulsamy
151f650bb2
Merge pull request #13 from jarulsamy/dev
v1.0.2
2020-09-06 15:39:10 -06:00
Joshua Arulsamy
5eceab7a22 📝 Add lyrics updates 2020-09-06 15:33:25 -06:00
Joshua Arulsamy
545654f9a7 Add lyrics command
Optionally grab lyrics of a song using the
lyrics command. Required LyricsGenius API token.
2020-09-06 15:32:40 -06:00
Joshua Arulsamy
57490cdf17
Merge pull request #12 from jarulsamy/dev
v1.0.1
2020-08-29 20:09:14 -06:00
Joshua Arulsamy
a6be6eac37 Merge branch 'master' into dev 2020-08-29 20:08:38 -06:00
Joshua Arulsamy
5ba7d751d0 👥 Add label of maintainer 2020-08-14 20:57:03 -06:00
Joshua Arulsamy
d0b6c25359 Pinned dependencies 2020-08-13 03:21:00 -06:00
Joshua Arulsamy
db188d968b 🎨 Static methods 2020-08-13 03:20:41 -06:00
Joshua Arulsamy
b05dd0598b
Merge pull request #11 from jarulsamy/dev
v1.0.1
2020-08-13 02:53:46 -06:00
Joshua Arulsamy
fc4682c210 🔖 Bump version 2020-08-13 02:52:48 -06:00
Joshua Arulsamy
228c2b480b Add custom help command 2020-08-13 02:52:22 -06:00
Joshua Arulsamy
08a235d55e 📝 Add docstrings 2020-08-13 02:52:11 -06:00
Joshua Arulsamy
880c4d50f1 📝 Update help 2020-08-13 02:51:34 -06:00
Joshua Arulsamy
f12701f4c5 🐛 Fix auto restart on dev env 2020-08-13 02:47:54 -06:00
Joshua Arulsamy
f95d5c1fd2 Add album playback features
Queue a whole album with one single command.
2020-08-13 02:27:46 -06:00
Joshua Arulsamy
56fd4aa5ab Makefile for dev and prod envs 2020-08-13 01:58:31 -06:00
Joshua Arulsamy
5f90b17b0e Switch to PlexAPI for search 2020-08-13 01:58:12 -06:00
Joshua Arulsamy
cf2bc24f8a 🐛 Fix always skip push 2020-08-10 03:03:54 -06:00
Joshua Arulsamy
1839cc5d03
Merge pull request #10 from codacy-badger/codacy-badge
Add a Codacy badge to README.md
2020-08-10 02:42:52 -06:00
The Codacy Badger
e6c4b84538 Add Codacy badge 2020-08-10 08:42:13 +00:00
Joshua Arulsamy
c1cba637b8
Merge pull request #9 from jarulsamy/dev
v1.0.0
2020-08-10 02:37:42 -06:00
Joshua Arulsamy
7f49c4d958 🔖 Tag release 2020-08-10 02:33:15 -06:00
Joshua Arulsamy
ed1a64cb52 🎨 Fix style of docstrings 2020-08-10 02:26:38 -06:00
Joshua Arulsamy
7471da85f7 Seperate field for pushing package 2020-08-10 02:25:48 -06:00
Joshua Arulsamy
4633247004 🐛 Cleaner builds, allow some compilation 2020-08-10 02:25:33 -06:00
Joshua Arulsamy
98a36c6cbc 🐛 Update to support shell scripts for deploy 2020-08-10 02:18:06 -06:00
Joshua Arulsamy
b7ab589f6e 🎨 Switch to shell scripts for deployment 2020-08-10 02:16:11 -06:00
Joshua Arulsamy
4aadd886d5 📝 Format fixes 2020-08-09 20:12:31 -06:00
Joshua Arulsamy
3e90c9e9ef
Merge pull request #8 from jarulsamy/dev
Docs Overhaul
2020-08-09 15:26:54 -06:00
Joshua Arulsamy
33bbf21bab Merge branch 'master' into dev 2020-08-09 15:26:01 -06:00
Joshua Arulsamy
253f2a9a82 🚀 Use docker pull instead of building repo 2020-08-09 15:24:50 -06:00
Joshua Arulsamy
af91883635 📝 Overhaul docs
Add better detail of bot creation

Add badges

Add sample docker-compose.yml
2020-08-09 15:24:15 -06:00
Joshua Arulsamy
cfd89ea6e8
Merge pull request #7 from jarulsamy/dev
v0.0.6
2020-08-09 14:48:58 -06:00
Joshua Arulsamy
9cbd0be424 🔖 Bump version 2020-08-09 14:48:17 -06:00
Joshua Arulsamy
1a8ec5f21f ♻️ Helpful documentation
Add docstrings and other useful comments.

Extended variable names to be more descriptive.
2020-08-09 14:47:00 -06:00
Joshua Arulsamy
d0aacc3f0b Bumped version 2020-08-09 02:44:57 -06:00
Joshua Arulsamy
9078ef616a
Merge pull request #6 from jarulsamy/dev
v0.0.4
2020-08-09 01:32:45 -06:00
Joshua Arulsamy
72935d8c7c 🚀 Stop deployment in favor of docker hub 2020-08-09 01:31:49 -06:00
Joshua Arulsamy
76d2d97c62 🚀 Automatic deployment through jenkins 2020-08-09 00:58:50 -06:00
Joshua Arulsamy
63fea747c6 🐛 Fix np status autoremoval 2020-08-09 00:35:27 -06:00
Joshua Arulsamy
d48188870e 🔊 Major changes to logging systems
Discord bot and plex operations are now logged seperatly.
2020-08-09 00:28:14 -06:00
Joshua Arulsamy
64a09def50 Remove unused dependency 2020-08-09 00:25:36 -06:00
Joshua Arulsamy
786a7d3742 Massive docker image size reduction 2020-08-09 00:25:09 -06:00
Joshua Arulsamy
5c45500450
Merge pull request #5 from jarulsamy/docker
Incremental Updates
2020-08-08 18:45:24 -06:00
Joshua Arulsamy
2d633acc67 🐛 Reduce dependency load of ffmpeg 2020-08-08 18:44:44 -06:00
Joshua Arulsamy
257ea91c4c 🐛 Add appropiate steps for docker build 2020-08-08 18:30:12 -06:00
Joshua Arulsamy
21c6bcc746 Add auto message deletion
Now playing messages now auto delete on song completion.
2020-08-08 18:08:51 -06:00
Joshua Arulsamy
7a8cd631a5
Merge pull request #4 from jarulsamy/docker
Async Improvements, v0.0.2
2020-08-08 17:21:23 -06:00
Joshua Arulsamy
81e0b50620 🙈 Deployment script 2020-08-08 17:18:11 -06:00
Joshua Arulsamy
9f9ba0f5e5 Add auto disconnect on idle
Bot now leaves a voice channel if nothing is playing for more than 15
seconds.
2020-08-08 17:07:21 -06:00
17 changed files with 1221 additions and 181 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
# Project specific
config.yaml
config/
deploy.sh
# Byte-compiled / optimized / DLL files
__pycache__/

View File

@ -1,11 +1,13 @@
# Python 3.7
FROM python:3.7
FROM python:3.7-slim
LABEL maintainer="Joshua Arulsamy <joshua.gf.arul@gmail.com>"
# Update system
RUN apt-get -y update
RUN apt-get -y upgrade
# Install ffmpeg
RUN apt-get install -y ffmpeg
RUN apt-get -y update && \
apt-get install -y --no-install-recommends ffmpeg=7:4.1.6-1~deb10u1 && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# All source code
WORKDIR /src
@ -14,11 +16,10 @@ WORKDIR /src
COPY requirements.txt .
# Install all dependencies.
RUN pip install -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy PlexBot over to src.
COPY PlexBot/ PlexBot
# Run the bot
# CMD ["python", "-OO", "-m", "PlexBot"]
CMD ["python", "-m", "PlexBot"]
CMD ["python", "-OO", "-m", "PlexBot"]

30
Jenkinsfile vendored
View File

@ -25,6 +25,7 @@ pipeline {
sh ''' conda create --yes -n ${BUILD_TAG} python
source /var/lib/jenkins/miniconda3/etc/profile.d/conda.sh
conda activate ${BUILD_TAG}
pip install -r requirements.txt
pip install pylint
'''
}
@ -35,7 +36,7 @@ pipeline {
echo "Style check"
sh ''' source /var/lib/jenkins/miniconda3/etc/profile.d/conda.sh
conda activate ${BUILD_TAG}
pylint CHANGE_ME || true
pylint PlexBot || true
'''
}
}
@ -47,20 +48,12 @@ pipeline {
}
}
steps {
sh ''' source /var/lib/jenkins/miniconda3/etc/profile.d/conda.sh
conda activate ${BUILD_TAG}
pwd
ls
python setup.py bdist_wheel
'''
sh './deploy/build.sh'
}
post {
always {
// Archive unit tests for the future
archiveArtifacts (allowEmptyArchive: true,
artifacts: 'dist/*whl',
fingerprint: true)
}
}
stage('Push Image') {
steps {
sh './deploy/push.sh'
}
}
}
@ -68,14 +61,7 @@ pipeline {
post {
always {
sh 'conda remove --yes -n ${BUILD_TAG} --all'
}
failure {
emailext (
subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at &QUOT;<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>&QUOT;</p>""",
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
)
sh 'docker system prune -a -f'
}
}
}

17
Makefile Normal file
View File

@ -0,0 +1,17 @@
.PHONY: help pull build clean
.DEFAULT_GOAL: build
help:
@echo "make pull"
@echo " Start docker container with pull"
@echo "make build"
@echo " Start docker container rebuilding container"
pull:
docker-compose up
build:
docker-compose -f docker-compose_dev.yml up --build
clean:
docker system prune -a

View File

@ -1,3 +1,7 @@
"""
Plex music bot for discord.
"""
import logging
import sys
from pathlib import Path
@ -8,19 +12,33 @@ import yaml
FORMAT = "%(asctime)s %(levelname)s: [%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s"
logging.basicConfig(format=FORMAT)
logger = logging.getLogger("PlexBot")
root_log = logging.getLogger()
plex_log = logging.getLogger("Plex")
bot_log = logging.getLogger("Bot")
def load_config(filename: str) -> Dict[str, str]:
def load_config(basedir: str,filename: str) -> Dict[str, str]:
"""Loads config from yaml file
Grabs key/value config pairs from a file.
Args:
filename: str path to yaml file.
Returns:
Dict[str, str] Values from config file.
Raises:
FileNotFound Configuration file not found.
"""
# All config files should be in /config
# for docker deployment.
filename = Path("/config", filename)
filename = Path(basedir, filename)
try:
with open(filename, "r") as f:
config = yaml.safe_load(f)
with open(filename, "r") as config_file:
config = yaml.safe_load(config_file)
except FileNotFoundError:
logging.fatal("Configuration file not found.")
root_log.fatal("Configuration file not found at '"+str(filename)+"'.")
sys.exit(-1)
# Convert str level type to logging constant
@ -31,7 +49,12 @@ def load_config(filename: str) -> Dict[str, str]:
"ERROR": logging.ERROR,
"CRITICAL": logging.CRITICAL,
}
level = config["general"]["log_level"]
config["general"]["log_level"] = levels[level.upper()]
config["root"]["log_level"] = levels[config["root"]["log_level"].upper()]
config["plex"]["log_level"] = levels[config["plex"]["log_level"].upper()]
config["discord"]["log_level"] = levels[config["discord"]["log_level"].upper()]
if config["lyrics"] and config["lyrics"]["token"].lower() == "none":
config["lyrics"] = None
return config

View File

@ -1,14 +1,21 @@
"""
Main entrypoint script.
Sets up loggers and initiates bot.
"""
import logging
from discord.ext.commands import Bot
from . import FORMAT
from . import load_config
from .bot import General
from .bot import Plex
from PlexBot import load_config
# Load config from file
config = load_config("config.yaml")
configdir = "config"
from os import geteuid
if geteuid() == 0:
configdir = "/config"
config = load_config(configdir,"config.yaml")
BOT_PREFIX = config["discord"]["prefix"]
TOKEN = config["discord"]["token"]
@ -16,14 +23,30 @@ TOKEN = config["discord"]["token"]
BASE_URL = config["plex"]["base_url"]
PLEX_TOKEN = config["plex"]["token"]
LIBRARY_NAME = config["plex"]["library_name"]
LOG_LEVEL = config["general"]["log_level"]
if config["lyrics"]:
LYRICS_TOKEN = config["lyrics"]["token"]
else:
LYRICS_TOKEN = None
# Set appropiate log level
logger = logging.getLogger("PlexBot")
logging.basicConfig(format=FORMAT)
logger.setLevel(LOG_LEVEL)
root_log = logging.getLogger()
plex_log = logging.getLogger("Plex")
bot_log = logging.getLogger("Bot")
plex_log.setLevel(config["plex"]["log_level"])
bot_log.setLevel(config["discord"]["log_level"])
plex_args = {
"base_url": BASE_URL,
"plex_token": PLEX_TOKEN,
"lib_name": LIBRARY_NAME,
"lyrics_token": LYRICS_TOKEN,
}
bot = Bot(command_prefix=BOT_PREFIX)
# Remove help command, we have our own custom one.
bot.remove_command("help")
bot.add_cog(General(bot))
bot.add_cog(Plex(bot, BASE_URL, PLEX_TOKEN, LIBRARY_NAME, BOT_PREFIX))
bot.add_cog(Plex(bot, **plex_args))
bot.run(TOKEN)

5
PlexBot/__version__.py Normal file
View File

@ -0,0 +1,5 @@
"""Track version number of package."""
VERSION = "1.0.3"
if __name__ == "__main__":
print(VERSION)

File diff suppressed because it is too large Load Diff

10
PlexBot/exceptions.py Normal file
View File

@ -0,0 +1,10 @@
class MediaNotFoundError(Exception):
"""Raised when a PlexAPI media resource cannot be found."""
pass
class VoiceChannelError(Exception):
"""Raised when user is not connected to a voice channel."""
pass

147
README.md
View File

@ -1,28 +1,74 @@
# Plex-Bot
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c93b8ff976ce4205a95046487917476b)](https://app.codacy.com/manual/jarulsamy/Plex-Bot?utm_source=github.com&utm_medium=referral&utm_content=jarulsamy/Plex-Bot&utm_campaign=Badge_Grade_Dashboard)
[![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)
![black badge](https://img.shields.io/badge/code%20style-black-000000.svg)
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
$ cd Plex-Bot
```
```bash
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"
```
```
$ mkdir config
$ cp sample-config.yaml config/config.yaml
```
3. Create a new `config` folder and create a config file like this::
3. Create a Discord bot application:
```bash
mkdir config
cd config
touch config.yaml
```
```yml
# 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](https://discord.com/developers/applications).
@ -38,44 +84,69 @@ $ cp sample-config.yaml config/config.yaml
6. 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`
7. 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. Get your Lyrics Genius token (Optional):
```
$ docker-compose up --build
If you would like to enable the lyrics feature of the bot, you need to signup for a free GeniusLyrics account, [here](https://genius.com/api-clients).
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:
```bash
docker-compose up -d
```
## Logs
You can view the logs with the following command
```bash
docker-compose logs -f CONTAINER_NAME_OR_ID
# For example
docker-compose logs -f PlexBot
```
## Usage
```
```text
General:
kill - Stop the bot.
kill [silent] - Halt the bot [silently].
help - Print this help message.
cleanup - Delete old messages from the bot.
Plex:
np - View currently playing song.
pause - Pause currently playing song.
play - Play a song from the Plex library.
resume - Resume a paused song.
skip - Skip a song.
stop - Stop playing.
No Category:
help Shows this message
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.
Type ?help command for more info on a command.
You can also type ?help category for more info on a category.
[] - Optional args.
```
## Support
Reach out to me at one of the following places!
- Email (Best) at joshua.gf.arul@gmail.com
- Twitter at <a href="http://twitter.com/jarulsamy_" target="_blank">`@jarulsamy_`</a>
* * *

BIN
assets/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

14
deploy/build.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
VERSION=$(python PlexBot/__version__.py)
docker build -t "jarulsamy/plex-bot:$VERSION" .
if [ $? -eq 0 ]
then
echo "Successfully build docker image."
exit 0
else
echo "Failed to build docker image." >&2
exit 1
fi

14
deploy/push.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
VERSION=$(python PlexBot/__version__.py)
docker push "jarulsamy/plex-bot:$VERSION"
if [ $? -eq 0 ]
then
echo "Successfully pushed docker image."
exit 0
else
echo "Failed to push docker image." >&2
exit 1
fi

View File

@ -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"

13
docker-compose_dev.yml Normal file
View File

@ -0,0 +1,13 @@
version: "3"
services:
plex-bot:
container_name: "PlexBot"
build: .
environment:
- PUID=1000
- PGID=1000
- TZ=America/Denver
# Required dir for configuration files
volumes:
- "./config:/config:ro"
restart: "no"

View File

@ -1,7 +1,7 @@
discord.py==1.3.4
discord.py==1.4.1
PlexAPI==4.0.0
fuzzywuzzy==0.18.0
python-Levenshtein==0.12.0
pynacl==1.4.0
ffmpeg==1.4
PyYAML==5.3.1
lyricsgenius==2.0.0

View File

@ -1,12 +1,16 @@
general:
# Options: debug, info, warning, error, critical
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: <CLIENT_ACCESS_TOKEN>