country_mode in database/ payment options

This commit is contained in:
Vladless
2025-12-10 12:44:27 +03:00
parent 1b1780df55
commit 877c005a6f
10 changed files with 196 additions and 91 deletions
+4 -1
View File
@@ -19,6 +19,7 @@ from config import (
USERNAME_BOT,
USE_COUNTRY_SELECTION,
)
from core.bootstrap import MODES_CONFIG
from database import get_key_details, get_servers
from database.models import Server
from handlers.texts import HAPP_ANNOUNCE, HIDDIFY_PROFILE_TITLE, SUBSCRIPTION_INFO_TEXT, V2RAYTUN_ANNOUNCE
@@ -73,7 +74,9 @@ async def get_subscription_urls(
server_id: str, email: str, session: AsyncSession, include_remnawave_key: str = None
) -> list[str]:
urls = []
if USE_COUNTRY_SELECTION:
use_country_selection = bool(MODES_CONFIG.get("COUNTRY_SELECTION_ENABLED", USE_COUNTRY_SELECTION))
if use_country_selection:
result = await session.execute(
select(Server.subscription_url).where(Server.server_name == server_id, Server.enabled.is_(True))
)