Bot become a Community Guard & Post send manager

added: dictionary support for censore
message/user management with dict triggers
This commit is contained in:
2025-08-22 21:44:14 +09:00
parent efdafb0efa
commit c16ec54891
27 changed files with 1746 additions and 184 deletions

View File

@@ -5,6 +5,7 @@ from dataclasses import dataclass
class Config:
bot_token: str
database_url: str
metrics_port: int = 8000
log_level: str = os.getenv("LOG_LEVEL", "INFO")
def load_config() -> "Config":
@@ -20,4 +21,5 @@ def load_config() -> "Config":
user = os.getenv("DB_USER", "postgres")
pwd = os.getenv("DB_PASSWORD", "postgres")
db_url = f"postgresql+psycopg://{user}:{pwd}@{host}:{port}/{name}"
return Config(bot_token=bot_token, database_url=db_url)
metric_port = int(os.getenv("METRICS_PORT", 9010))
return Config(bot_token=bot_token, database_url=db_url, metrics_port=metric_port)