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
36 lines (32 loc) · 1.7 KB
/
Copy pathvars.py
File metadata and controls
36 lines (32 loc) · 1.7 KB
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
# This file is a part of TG-FileStreamBot
# Coding : Jyothis Jayanth [@EverythingSuckz]
import sys
from os import environ
from dotenv import load_dotenv
load_dotenv()
class Var(object):
MULTI_CLIENT = False
API_ID = int(environ.get("API_ID"))
API_HASH = str(environ.get("API_HASH"))
BOT_TOKEN = str(environ.get("BOT_TOKEN"))
SLEEP_THRESHOLD = int(environ.get("SLEEP_THRESHOLD", "60")) # 1 minte
WORKERS = int(environ.get("WORKERS", "6")) # 6 workers = 6 commands at once
BIN_CHANNEL = int(
environ.get("BIN_CHANNEL", None)
) # you NEED to use a CHANNEL when you're using MULTI_CLIENT
PORT = int(environ.get("PORT", 8080))
BIND_ADDRESS = str(environ.get("WEB_SERVER_BIND_ADDRESS", "0.0.0.0"))
PING_INTERVAL = int(environ.get("PING_INTERVAL", "1200")) # 20 minutes
HAS_SSL = str(environ.get("HAS_SSL", "0").lower()) in ("1", "true", "t", "yes", "y")
NO_PORT = str(environ.get("NO_PORT", "0").lower()) in ("1", "true", "t", "yes", "y")
HASH_LENGTH = int(environ.get("HASH_LENGTH", 6))
if not 5 < HASH_LENGTH < 64:
sys.exit("Hash length should be greater than 5 and less than 64")
FQDN = str(environ.get("FQDN", BIND_ADDRESS))
URL = "http{}://{}{}/".format(
"s" if HAS_SSL else "", FQDN, "" if NO_PORT else ":" + str(PORT)
)
KEEP_ALIVE = str(environ.get("KEEP_ALIVE", "0").lower()) in ("1", "true", "t", "yes", "y")
DEBUG = str(environ.get("DEBUG", "0").lower()) in ("1", "true", "t", "yes", "y")
USE_SESSION_FILE = str(environ.get("USE_SESSION_FILE", "0").lower()) in ("1", "true", "t", "yes", "y")
ALLOWED_USERS = [x.strip("@ ") for x in str(environ.get("ALLOWED_USERS", "") or "").split(",") if x.strip("@ ")]