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

16
run.py
View File

@@ -90,6 +90,20 @@ async def setupplex(ctx):
reload()
await ctx.author.send("Bot has been restarted. Give it a few seconds. Please check logs and make sure you see the line: `Logged into plex`. If not run this command again and make sure you enter the right values. ")
print("Bot has been restarted. Give it a few seconds.")
@bot.command()
@commands.has_permissions(administrator=True)
async def setuplibs(ctx):
libs = ""
libs = await getplex(ctx, "libs")
if libs is None:
return
else:
confighelper.change_config("plex_libs", str(libs))
print("Plex libraries updated. Restarting bot.")
reload()
await ctx.author.send("Bot has been restarted. Give it a few seconds. Please check logs and make sure you see the line: `Logged into plex`. If not run this command again and make sure you enter the right values. ")
print("Bot has been restarted. Give it a few seconds.")
bot.load_extension(f'app.bot.cogs.app')
bot.run(Discord_bot_token)