forked from EverythingSuckz/TG-FileStreamBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvars.py
More file actions
27 lines (24 loc) · 1005 Bytes
/
Copy pathvars.py
File metadata and controls
27 lines (24 loc) · 1005 Bytes
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
# This file is a part of TG-FileStreamBot
# Coding : Jyothis Jayanth [@EverythingSuckz]
from os import getenv, environ
from dotenv import load_dotenv
load_dotenv()
class Var(object):
API_ID = int(getenv('API_ID'))
API_HASH = str(getenv('API_HASH'))
BOT_TOKEN = str(getenv('BOT_TOKEN'))
SLEEP_THRESHOLD = int(getenv('SLEEP_THRESHOLD', '60'))
WORKERS = int(getenv('WORKERS', '3'))
BIN_CHANNEL = int(getenv('BIN_CHANNEL', None))
PORT = int(getenv('PORT', 8080))
BIND_ADRESS = str(getenv('WEB_SERVER_BIND_ADDRESS', '0.0.0.0'))
# OWNER_ID = int(getenv('OWNER_ID')) #TODO
NO_PORT = bool(getenv('NO_PORT', False))
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'
URL = "https://{}/".format(FQDN) if ON_HEROKU or NO_PORT else \
"http://{}:{}/".format(FQDN, PORT)