- Add subscription_link column to users table (nullable, unique) - Add SUBSCRIPTION_URL to config settings - Update user creation to include subscription link from Remnawave - Add support subscription ticket creation with formatted message - Add "update link" button to main menu - Refactor support subscription formatting to include user details
25 lines
922 B
Python
25 lines
922 B
Python
from typing import Optional
|
|
from pydantic_settings import BaseSettings
|
|
from pydantic import Field
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv(override=True)
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
bot_token: str = Field(alias="BOT_TOKEN")
|
|
postgres_url: str = Field(alias="POSTGRES_URL")
|
|
proxy: Optional[str] = Field(None, alias="PROXY")
|
|
admin_group_id: int = Field(alias="ADMIN_GROUP_ID")
|
|
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
|