26 lines
645 B
Python
26 lines
645 B
Python
from environs import Env
|
|
|
|
|
|
|
|
CONFIG_FILE = '.env'
|
|
|
|
env = Env()
|
|
env.read_env(CONFIG_FILE)
|
|
|
|
token = env.str("token")
|
|
db_url = env.str("database_url", "sqlite:///database.sqlite3")
|
|
permission_file = env.str("permission_file", "permission.json")
|
|
|
|
use_webhook = env.bool("use_webhook", False)
|
|
skip_updates = env.bool("skip_update", True)
|
|
telegram_api_server = env.str("telegram_api_server", "https://api.telegram.org")
|
|
|
|
if use_webhook:
|
|
webhook_app_host = env.str("app_host")
|
|
webhook_app_port = env.int("app_port")
|
|
|
|
webhook_host = env.str("webhook_host")
|
|
|
|
webhook_path = f"/bot{token}"
|
|
webhook_url = f"{webhook_host}{webhook_path}"
|