-
Notifications
You must be signed in to change notification settings - Fork 277
/
settings.py
35 lines (29 loc) · 1.33 KB
/
settings.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
import os
from dotenv import load_dotenv, find_dotenv
# Loading .env variables
load_dotenv(find_dotenv())
TELEGRAM_TOKEN = os.getenv("TELEGRAM_TOKEN")
if TELEGRAM_TOKEN is None:
raise Exception("Please setup the .env variable TELEGRAM_TOKEN.")
PORT = int(os.environ.get("PORT", "8443"))
HEROKU_APP_NAME = os.getenv("HEROKU_APP_NAME")
TELEGRAM_SUPPORT_CHAT_ID = os.getenv("TELEGRAM_SUPPORT_CHAT_ID")
if (
TELEGRAM_SUPPORT_CHAT_ID is None
or not str(TELEGRAM_SUPPORT_CHAT_ID).lstrip("-").isdigit()
):
raise Exception(
"You need to specify 'TELEGRAM_SUPPORT_CHAT_ID' env variable: The bot will forward all messages to this chat_id. Add this bot https://t.me/ShowJsonBot to your private chat to find its chat_id."
)
TELEGRAM_SUPPORT_CHAT_ID = int(TELEGRAM_SUPPORT_CHAT_ID)
WELCOME_MESSAGE = os.getenv("WELCOME_MESSAGE", "👋")
REPLY_TO_THIS_MESSAGE = os.getenv("REPLY_TO_THIS_MESSAGE", "REPLY_TO_THIS")
WRONG_REPLY = os.getenv("WRONG_REPLY", "WRONG_REPLY")
FORWARD_MODE = os.getenv("FORWARD_MODE", "support_chat")
PERSONAL_ACCOUNT_CHAT_ID = os.getenv("PERSONAL_ACCOUNT_CHAT_ID")
if (
PERSONAL_ACCOUNT_CHAT_ID is None
or not str(PERSONAL_ACCOUNT_CHAT_ID).lstrip("-").isdigit()
):
raise Exception("You need to specify 'PERSONAL_ACCOUNT_CHAT_ID' env variable.")
PERSONAL_ACCOUNT_CHAT_ID = int(PERSONAL_ACCOUNT_CHAT_ID)