diff --git a/pyUltroid/startup/funcs.py b/pyUltroid/startup/funcs.py index f4ac361..3c2c63b 100644 --- a/pyUltroid/startup/funcs.py +++ b/pyUltroid/startup/funcs.py @@ -41,8 +41,8 @@ from telethon.tl.types import ( InputMessagesFilterDocument, ) from telethon.utils import get_peer_id - -from .. import LOGS, ULTConfig +from decouple import config, RepositoryEnv +from.. import LOGS, ULTConfig from ..fns.helper import download_file, inline_mention, updater db_url = 0 @@ -90,12 +90,15 @@ def update_envs(): """Update Var. attributes to udB""" from .. import udB - for envs in list(os.environ): + for envs in [*list(os.environ), *list(RepositoryEnv(config._find_file(".")).data)]: if ( envs in ["LOG_CHANNEL", "BOT_TOKEN", "BOTMODE", "DUAL_MODE", "language"] or envs in udB.keys() ): - udB.set_key(envs, os.environ[envs]) + if _value := os.environ.get(envs): + udB.set_key(envs, _value) + else: + udB.set_key(envs, config.config.get(envs)) async def startup_stuff():