added command to update plex libs

This commit is contained in:
Faiz Ahmed
2021-07-26 12:34:18 -04:00
parent 94b826babd
commit 88499c7e09
3 changed files with 32 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ roles = None
PLEXUSER = ""
PLEXPASS = ""
PLEX_SERVER_NAME = ""
Plex_LIBS = ["all"]
Plex_LIBS = None
if(path.exists('app/config/config.ini')):
try:
@@ -33,6 +33,11 @@ if(path.exists('app/config/config.ini')):
roles = config.get(BOT_SECTION, 'roles')
except:
pass
if(path.exists('app/config/config.ini')):
try:
Plex_LIBS = config.get(BOT_SECTION, 'plex_libs')
except:
pass
try:
account = MyPlexAccount(PLEXUSER, PLEXPASS)
@@ -44,6 +49,11 @@ except:
if roles is not None:
roles = list(roles.split(','))
if Plex_LIBS is None:
Plex_LIBS = ["all"]
else:
Plex_LIBS = list(Plex_LIBS.split(', '))
print(Plex_LIBS)
class app(commands.Cog):
def __init__(self, bot):

View File

@@ -16,7 +16,7 @@ roles = None
PLEXUSER = ""
PLEXPASS = ""
PLEX_SERVER_NAME = ""
Plex_LIBS = ["all"]
Plex_LIBS = None
switch = 0
@@ -59,7 +59,11 @@ if(path.exists('app/config/config.ini')):
roles = config.get(BOT_SECTION, 'roles')
except:
pass
if(path.exists('app/config/config.ini')):
try:
Plex_LIBS = config.get(BOT_SECTION, 'plex_libs')
except:
pass
def get_config():
"""
Function to return current config