добавил discord_perm как переменную конфига - роль, имеющая право на отдачу команд серверу.

This commit is contained in:
fixebr@gmail.com
2024-02-04 20:11:12 +03:00
parent 254f443165
commit d19a9cef00
3 changed files with 36 additions and 22 deletions

View File

@@ -12,7 +12,7 @@ config = configparser.ConfigParser()
CONFIG_KEYS = ['username', 'password', 'discord_bot_token', 'plex_user', 'plex_pass', 'plex_token',
'plex_base_url', 'plex_roles', 'plex_server_name', 'plex_libs', 'owner_id', 'channel_id',
'auto_remove_user', 'jellyfin_api_key', 'jellyfin_server_url', 'jellyfin_roles',
'jellyfin_libs', 'plex_enabled', 'jellyfin_enabled', 'jellyfin_external_url']
'jellyfin_libs', 'plex_enabled', 'jellyfin_enabled', 'jellyfin_external_url', 'discord_perm']
# settings
Discord_bot_token = ""
@@ -29,6 +29,7 @@ jellyfin_libs = ""
jellyfin_roles = None
plex_configured = True
jellyfin_configured = True
DISCORD_SERVER_PERM = ""
switch = 0
@@ -153,6 +154,12 @@ except:
print("Не удалось получить конфигурацию включения Plex. По умолчанию установлено значение False")
USE_PLEX = False
try:
DISCORD_SERVER_PERM = config.get(BOT_SECTION, "discord_perm")
except:
DISCORD_SERVER_PERM = None
print("Не удалось получить id роли для управления ботом. Возможна любая дичь.")
def get_config():
"""
Function to return current config