Update variables from .env

This commit is contained in:
buddhhu
2023-05-15 22:38:55 +05:30
parent 24e7379c59
commit d2351e5c02

View File

@@ -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():