27 lines
746 B
Python
27 lines
746 B
Python
from environs import Env
|
|
|
|
|
|
CONFIG_FILE = '.env'
|
|
|
|
env = Env()
|
|
env.read_env(CONFIG_FILE)
|
|
|
|
token: str = env.str("TOKEN")
|
|
service_chat: int = env.int("SERVICE_CHAT")
|
|
|
|
db_url: str = env.str("DATABASE_URL", "sqlite:///database.sqlite3")
|
|
permission_file: str = env.str("PERMISSION_FILE", "permission.json")
|
|
|
|
use_webhook: bool = env.bool("USE_WEBHOOK", False)
|
|
skip_updates: bool = env.bool("SKIP_UPDATE", True)
|
|
telegram_api_server: str = env.str("TELEGRAM_API_SERVER", "https://api.telegram.org")
|
|
|
|
if use_webhook:
|
|
webhook_app_host: str = env.str("APP_HOST")
|
|
webhook_app_port: int = env.int("APP_PORT")
|
|
|
|
webhook_host: str = env.str("WEBHOOK_HOST")
|
|
|
|
webhook_path: str = f"/bot{token}"
|
|
webhook_url: str = f"{webhook_host}{webhook_path}"
|