mirror of
https://github.com/jarulsamy/Plex-Bot.git
synced 2024-08-19 15:01:55 +02:00
d48188870e
Discord bot and plex operations are now logged seperatly.
32 lines
792 B
Python
32 lines
792 B
Python
import logging
|
|
|
|
from discord.ext.commands import Bot
|
|
|
|
from . import FORMAT
|
|
from .bot import General
|
|
from .bot import Plex
|
|
from PlexBot import load_config
|
|
|
|
# Load config from file
|
|
config = load_config("config.yaml")
|
|
|
|
BOT_PREFIX = config["discord"]["prefix"]
|
|
TOKEN = config["discord"]["token"]
|
|
|
|
BASE_URL = config["plex"]["base_url"]
|
|
PLEX_TOKEN = config["plex"]["token"]
|
|
LIBRARY_NAME = config["plex"]["library_name"]
|
|
|
|
# Set appropiate 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"])
|
|
|
|
bot = Bot(command_prefix=BOT_PREFIX)
|
|
bot.add_cog(General(bot))
|
|
bot.add_cog(Plex(bot, BASE_URL, PLEX_TOKEN, LIBRARY_NAME, BOT_PREFIX))
|
|
bot.run(TOKEN)
|