24 lines
728 B
Python

import os
class Config:
# bot setup
BOT_TOKEN: str = os.getenv("BOT_TOKEN")
OWNER_ID: int = int(os.getenv("OWNER_ID", 1))
LOG_LEVEL: str = os.getenv("LOG_LEVEL", "INFO")
# bot behaviour
DROP_PENDING: bool = bool(int(os.getenv("DROP_PENDING", True)))
TIMEOUT: int = int(os.getenv("TIMEOUT", 20))
POLLING_TIMEOUT: int = int(os.getenv("POLLING_TIMEOUT", 20))
NUM_THREADS: int = int(os.getenv("NUM_THREADS", 2))
PARSE_MODE: str = os.getenv("PARSE_MODE", "html")
# i18n
I18N_PATH: str = os.getenv("I18N_PATH", "i18n.yaml")
I18N_LANG: str = os.getenv("I18N_LANG", "en")
def __init__(self):
if not self.BOT_TOKEN:
raise RuntimeError("Missing BOT_TOKEN")