forked from bisnuray/RestrictedContentDL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
31 lines (25 loc) · 845 Bytes
/
config.py
File metadata and controls
31 lines (25 loc) · 845 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
28
29
30
31
# Copyright (C) @TheSmartBisnu
# Channel: https://t.me/itsSmartDev
from os import getenv
from time import time
from dotenv import load_dotenv
try:
load_dotenv("config.env")
except:
pass
if not getenv("BOT_TOKEN") or not getenv("BOT_TOKEN").count(":") == 1:
print("Error: BOT_TOKEN must be in format '123456:abcdefghijklmnopqrstuvwxyz'")
exit(1)
if (
not getenv("SESSION_STRING")
or getenv("SESSION_STRING") == "xxxxxxxxxxxxxxxxxxxxxxx"
):
print("Error: SESSION_STRING must be set with a valid string")
exit(1)
# Pyrogram setup
class PyroConf(object):
API_ID = int(getenv("API_ID", "6"))
API_HASH = getenv("API_HASH", "eb06d4abfb49dc3eeb1aeb98ae0f581e")
BOT_TOKEN = getenv("BOT_TOKEN")
SESSION_STRING = getenv("SESSION_STRING")
BOT_START_TIME = time()