-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathvars.py
41 lines (36 loc) · 1.47 KB
/
vars.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
import os
from os import getenv, environ
from dotenv import load_dotenv
load_dotenv()
class Var(object):
MULTI_CLIENT = False
API_ID = int(getenv('API_ID'))
API_HASH = str(getenv('API_HASH'))
BOT_TOKEN = str(getenv('BOT_TOKEN'))
name = str(getenv('name', 'filetolinkbot'))
SLEEP_THRESHOLD = int(getenv('SLEEP_THRESHOLD', '60'))
WORKERS = int(getenv('WORKERS', '4'))
BIN_CHANNEL = int(getenv('BIN_CHANNEL'))
PORT = int(getenv('PORT', 8080))
BIND_ADRESS = str(getenv('WEB_SERVER_BIND_ADDRESS', '0.0.0.0'))
PING_INTERVAL = int(environ.get("PING_INTERVAL", "1200")) # 20 minutes
OWNER_ID = set(int(x) for x in os.environ.get("OWNER_ID", "").split())
NO_PORT = bool(getenv('NO_PORT', False))
APP_NAME = None
OWNER_USERNAME = str(getenv('OWNER_USERNAME'))
if 'DYNO' in environ:
ON_HEROKU = True
APP_NAME = str(getenv('APP_NAME'))
else:
ON_HEROKU = False
FQDN = str(getenv('FQDN', BIND_ADRESS)) if not ON_HEROKU or getenv('FQDN') else APP_NAME+'.herokuapp.com'
HAS_SSL=bool(getenv('HAS_SSL',False))
if HAS_SSL:
# URL = "https://{}/".format(FQDN)
URL = FQDN
else:
#URL = "https://{}/".format(FQDN)
URL = FQDN
DATABASE_URL = str(getenv('DATABASE_URL'))
UPDATES_CHANNEL = str(getenv('UPDATES_CHANNEL', None))
BANNED_CHANNELS = list(set(int(x) for x in str(getenv("BANNED_CHANNELS", "-1001362659779")).split()))