From 9a3072088099f390b7e589433a292b51066da589 Mon Sep 17 00:00:00 2001 From: Faiz Ahmed Date: Sat, 17 Jul 2021 18:47:49 -0400 Subject: [PATCH] on member update --- app/cogs/Invitarr.py | 8 +++++--- app/helper/confighelper.py | 8 ++++++++ bot.env | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/cogs/Invitarr.py b/app/cogs/Invitarr.py index f7a65bc..c9ebf74 100644 --- a/app/cogs/Invitarr.py +++ b/app/cogs/Invitarr.py @@ -12,8 +12,7 @@ import sys from app.header.configparser import roleid, PLEXUSER, PLEXPASS, PLEX_SERVER_NAME, Plex_LIBS, chan, ownerid, auto_remove_user sys.stdout = sys.stderr -Plex_LIBS = list(Plex_LIBS.split(',')) -roleid = list(roleid.split(',')) + if auto_remove_user: print("auto remove user = True") @@ -23,7 +22,10 @@ account = MyPlexAccount(PLEXUSER, PLEXPASS) plex = account.resource(PLEX_SERVER_NAME).connect() # returns a PlexServer instance class app(commands.Cog): - + + def __init__(self, bot): + self.bot = bot + @commands.Cog.listener() async def on_ready(self): print('Made by Sleepingpirate https://github.com/Sleepingpirates/') diff --git a/app/helper/confighelper.py b/app/helper/confighelper.py index 45a6326..9d2f038 100644 --- a/app/helper/confighelper.py +++ b/app/helper/confighelper.py @@ -64,6 +64,14 @@ try: ownerid = int(config.get(BOT_SECTION, 'owner_id')) auto_remove_user = config.get(BOT_SECTION, 'auto_remove_user') if config.get(BOT_SECTION, 'auto_remove_user') else False switch = 1 + + if switch == 1: + if plex_libs.lower() == "all" + continue + else: + Plex_LIBS = list(Plex_LIBS.split(',')) + roleid = list(roleid.split(',')) + except: print("Cannot find config/Incomplete config") diff --git a/bot.env b/bot.env index 9935c4c..1af793f 100644 --- a/bot.env +++ b/bot.env @@ -1,8 +1,8 @@ discord_bot_token= plex_username= plex_password= -role_id= plex_server_name= plex_libs= owner_id= -channel_id= \ No newline at end of file +role_id= +channel_id= \ No newline at end of file