forked from TeamUltroid/Ultroid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigs.py
55 lines (49 loc) · 1.75 KB
/
configs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Ultroid - UserBot
# Copyright (C) 2021-2022 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://github.com/TeamUltroid/pyUltroid/blob/main/LICENSE>.
import sys
from decouple import config
try:
from dotenv import load_dotenv
load_dotenv()
except ImportError:
pass
class Var:
# mandatory
API_ID = (
int(sys.argv[1]) if len(sys.argv) > 1 else config("API_ID", default=6, cast=int)
)
API_HASH = (
sys.argv[2]
if len(sys.argv) > 2
else config("API_HASH", default="eb06d4abfb49dc3eeb1aeb98ae0f581e")
)
SESSION = sys.argv[3] if len(sys.argv) > 3 else config("SESSION", default=None)
REDIS_URI = (
sys.argv[4]
if len(sys.argv) > 4
else (config("REDIS_URI", default=None) or config("REDIS_URL", default=None))
)
REDIS_PASSWORD = (
sys.argv[5] if len(sys.argv) > 5 else config("REDIS_PASSWORD", default=None)
)
# extras
BOT_TOKEN = config("BOT_TOKEN", default=None)
LOG_CHANNEL = config("LOG_CHANNEL", default=0, cast=int)
HEROKU_APP_NAME = config("HEROKU_APP_NAME", default=None)
HEROKU_API = config("HEROKU_API", default=None)
VC_SESSION = config("VC_SESSION", default=None)
ADDONS = config("ADDONS", default=False, cast=bool)
VCBOT = config("VCBOT", default=False, cast=bool)
# for railway
REDISPASSWORD = config("REDISPASSWORD", default=None)
REDISHOST = config("REDISHOST", default=None)
REDISPORT = config("REDISPORT", default=None)
REDISUSER = config("REDISUSER", default=None)
# for sql
DATABASE_URL = config("DATABASE_URL", default=None)
# for MONGODB users
MONGO_URI = config("MONGO_URI", default=None)