diff --git a/client.py b/client.py index dfa928dc..f31967ab 100644 --- a/client.py +++ b/client.py @@ -25,7 +25,7 @@ async def add_client( id=client_id, email=email.lower(), limit_ip=limit_ip, - total_gb = TOTAL_GB, + total_gb=TOTAL_GB, expiry_time=expiry_time, enable=enable, tg_id=tg_id, diff --git a/handlers/admin/admin_user_editor.py b/handlers/admin/admin_user_editor.py index 07673ee9..768ecae3 100644 --- a/handlers/admin/admin_user_editor.py +++ b/handlers/admin/admin_user_editor.py @@ -300,22 +300,18 @@ async def handle_key_name_input(message: types.Message, state: FSMContext): key_buttons.row( InlineKeyboardButton( text="⏳ Изменить время истечения", - callback_data=f"change_expiry|{email}" + callback_data=f"change_expiry|{email}", ) ) key_buttons.row( InlineKeyboardButton( - text="❌ Удалить ключ", - callback_data=f"delete_key_admin|{email}" + text="❌ Удалить ключ", callback_data=f"delete_key_admin|{email}" ) ) key_buttons.row( - InlineKeyboardButton( - text="🔙 Назад", - callback_data="back_to_user_editor" - ) - ) + InlineKeyboardButton(text="🔙 Назад", callback_data="back_to_user_editor") + ) await message.reply( "\n".join(response_messages), diff --git a/handlers/payments/cryprobot_pay.py b/handlers/payments/cryprobot_pay.py index 2e5dd39a..bfad4bf3 100644 --- a/handlers/payments/cryprobot_pay.py +++ b/handlers/payments/cryprobot_pay.py @@ -77,6 +77,12 @@ async def process_callback_pay_cryptobot( callback_data=PAYMENT_OPTIONS[i]["callback_data"], ) ) + builder.row( + InlineKeyboardButton( + text="💰 Ввести свою сумму", callback_data="enter_custom_amount" + ) + ) + builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="back_to_profile")) key_count = await get_key_count(tg_id) diff --git a/handlers/payments/freekassa_pay.py b/handlers/payments/freekassa_pay.py index a916e587..dc4007e1 100644 --- a/handlers/payments/freekassa_pay.py +++ b/handlers/payments/freekassa_pay.py @@ -119,6 +119,12 @@ async def process_callback_pay_freekassa( callback_data=PAYMENT_OPTIONS[i]["callback_data"], ) ) + builder.row( + InlineKeyboardButton( + text="💰 Ввести свою сумму", callback_data="enter_custom_amount" + ) + ) + builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="back_to_profile")) await bot.delete_message( chat_id=tg_id, message_id=callback_query.message.message_id diff --git a/handlers/payments/stars_pay.py b/handlers/payments/stars_pay.py index 695ed355..83002603 100644 --- a/handlers/payments/stars_pay.py +++ b/handlers/payments/stars_pay.py @@ -72,6 +72,12 @@ async def process_callback_pay_stars( callback_data=PAYMENT_OPTIONS[i]["callback_data"], ) ) + builder.row( + InlineKeyboardButton( + text="💰 Ввести свою сумму", callback_data="enter_custom_amount" + ) + ) + builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="back_to_profile")) key_count = await get_key_count(tg_id) diff --git a/handlers/payments/yookassa_pay.py b/handlers/payments/yookassa_pay.py index 894e9090..87d59a43 100644 --- a/handlers/payments/yookassa_pay.py +++ b/handlers/payments/yookassa_pay.py @@ -63,24 +63,32 @@ async def process_callback_pay_yookassa( builder = InlineKeyboardBuilder() - for i in range(0, 4, 2): - builder.row( - InlineKeyboardButton( - text=PAYMENT_OPTIONS[i]["text"], - callback_data=PAYMENT_OPTIONS[i]["callback_data"], - ), - InlineKeyboardButton( - text=PAYMENT_OPTIONS[i + 1]["text"], - callback_data=PAYMENT_OPTIONS[i + 1]["callback_data"], - ), - ) - - for i in range(4, len(PAYMENT_OPTIONS)): - builder.row( - InlineKeyboardButton( - text=PAYMENT_OPTIONS[i]["text"], - callback_data=PAYMENT_OPTIONS[i]["callback_data"], + for i in range(0, len(PAYMENT_OPTIONS), 2): + if i + 1 < len(PAYMENT_OPTIONS): + builder.row( + InlineKeyboardButton( + text=PAYMENT_OPTIONS[i]["text"], + callback_data=PAYMENT_OPTIONS[i]["callback_data"], + ), + InlineKeyboardButton( + text=PAYMENT_OPTIONS[i + 1]["text"], + callback_data=PAYMENT_OPTIONS[i + 1]["callback_data"], + ), ) + else: + builder.row( + InlineKeyboardButton( + text=PAYMENT_OPTIONS[i]["text"], + callback_data=PAYMENT_OPTIONS[i]["callback_data"], + ) + ) + builder.row( + InlineKeyboardButton( + text="💰 Ввести свою сумму", callback_data="enter_custom_amount" + ) + ) + builder.row( + InlineKeyboardButton(text="⬅️ Назад", callback_data="back_to_profile") ) key_count = await get_key_count(tg_id) diff --git a/handlers/start.py b/handlers/start.py index b2c0b553..70aac888 100644 --- a/handlers/start.py +++ b/handlers/start.py @@ -8,7 +8,7 @@ from aiogram.utils.keyboard import InlineKeyboardBuilder from loguru import logger from bot import bot -from config import APP_URL, CHANNEL_URL, DATABASE_URL, SUPPORT_CHAT_URL, DOWNLOAD_IOS, DOWNLOAD_ANDROID, CONNECT_ANDROID, CONNECT_IOS +from config import CHANNEL_URL, CONNECT_ANDROID, CONNECT_IOS, DATABASE_URL, DOWNLOAD_ANDROID, DOWNLOAD_IOS, SUPPORT_CHAT_URL from database import add_connection, add_referral, check_connection_exists, get_trial from handlers.keys.trial_key import create_trial_key from handlers.texts import INSTRUCTIONS_TRIAL, WELCOME_TEXT, get_about_vpn