Create config.py
Browse files
config.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from os import getenv
|
3 |
+
from dotenv import load_dotenv
|
4 |
+
|
5 |
+
load_dotenv()
|
6 |
+
ENVIRONMENT = os.environ.get('ENVIRONMENT', True)
|
7 |
+
if ENVIRONMENT:
|
8 |
+
try:
|
9 |
+
API_ID = os.environ["API_ID"]
|
10 |
+
except ValueError:
|
11 |
+
raise Exception("Your API_ID is not a valid integer.")
|
12 |
+
API_HASH = os.environ["API_HASH"]
|
13 |
+
BOT_TOKEN = os.environ["BOT_TOKEN"]
|