- Added notifications for successful payments in `api/core/notifications.py`. - Created main API entry point in `api/main.py` with FastAPI integration. - Established routing structure in `api/routes/__init__.py` and `api/routes/pally.py` for handling payment callbacks. - Developed billing handlers in `bot/handlers/billing.py` and `bot/handlers/buy.py` for subscription management. - Introduced state management for user interactions in `bot/states/`. - Created user interface elements in `bot/keyboards/` for navigation and payment processing. - Set up middleware for dependency injection in `bot/middlewares/di.py`. - Added support for user commands and interactions in `bot/handlers/common.py` and `bot/handlers/support.py`. - Implemented logging and error handling throughout the bot's functionality. - Created entry point script for API server in `entrypoints/api.sh`.
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from dotenv import load_dotenv
|
|
from pydantic import Field
|
|
from pydantic_settings import BaseSettings
|
|
|
|
load_dotenv(override=True)
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
postgres_url: str = Field(
|
|
"postgresql+asyncpg://malenia:skibidi@localhost:5432/malenia_db", alias="POSTGRES_URL"
|
|
)
|
|
|
|
bot_token: str = Field(alias="BOT_TOKEN")
|
|
|
|
pally_shop_id: str = Field(alias="PALLY_SHOP_ID")
|
|
pally_token: str = Field(alias="PALLY_TOKEN")
|
|
|
|
referal_bonus: int = Field(10, alias="REFERAL_BONUS")
|
|
|
|
proxy: str | None = Field(None, alias="PROXY")
|
|
|
|
remnawave_url: str = Field(alias="REMNAWAVE_URL")
|
|
subscription_url: str = Field(alias="SUBSCRIPTION_URL")
|
|
remnawave_token: str = Field(alias="REMNAWAVE_TOKEN")
|
|
|
|
min_devices: int = Field(3, alias="MIN_DEVICES")
|
|
max_devices: int = Field(12, alias="MAX_DEVICES")
|
|
per_device_cost: int = Field(50, alias="PER_DEVICE_COST")
|
|
whitelist_cost: int = Field(100, alias="WHITELIST_COST")
|
|
whitelist_device_threshold: int = Field(6, alias="WHITELIST_DEVICE_THRESHOLD")
|
|
|
|
|
|
settings = Settings() # type: ignore
|