Skip to content

Commit

Permalink
Update variables from .env
Browse files Browse the repository at this point in the history
  • Loading branch information
buddhhu committed May 15, 2023
1 parent 24e7379 commit d2351e5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pyUltroid/startup/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
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
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit d2351e5

Please sign in to comment.