Merge pull request #83 from izzzzzi/main

Add multypay
This commit is contained in:
Vladislav Lisitsyn
2024-11-11 23:03:26 +03:00
committed by GitHub
6 changed files with 34 additions and 32 deletions
+3 -6
View File
@@ -574,14 +574,11 @@ async def process_callback_renew_plan(callback_query: types.CallbackQuery):
balance = await get_balance(tg_id)
if balance < cost:
replenish_button = types.InlineKeyboardButton(
text="Пополнить баланс", callback_data="replenish_balance"
)
back_button = types.InlineKeyboardButton(
text="Назад", callback_data="view_profile"
view_profile = types.InlineKeyboardButton(
text="👤 Мой профиль", callback_data="view_profile"
)
keyboard = types.InlineKeyboardMarkup(
inline_keyboard=[[replenish_button], [back_button]]
inline_keyboard=[[view_profile]]
)
await bot.send_message(
-12
View File
@@ -104,12 +104,6 @@ async def notify_10h_keys(
callback_data=f'renew_key|{record["client_id"]}',
)
],
[
types.InlineKeyboardButton(
text="💳 Пополнить баланс",
callback_data="replenish_balance",
)
],
[
types.InlineKeyboardButton(
text="👤 Мой профиль", callback_data="view_profile"
@@ -182,12 +176,6 @@ async def notify_24h_keys(
callback_data=f'renew_key|{record["client_id"]}',
)
],
[
types.InlineKeyboardButton(
text="💳 Пополнить баланс",
callback_data="replenish_balance",
)
],
[
types.InlineKeyboardButton(
text="👤 Мой профиль", callback_data="view_profile"
+2 -2
View File
@@ -50,8 +50,8 @@ async def send_message_with_deletion(
return sent_message
@router.callback_query(F.data == "replenish_balance")
async def process_callback_replenish_balance(
@router.callback_query(F.data == "pay_cryptobot")
async def process_callback_pay_cryptobot(
callback_query: types.CallbackQuery, state: FSMContext
):
tg_id = callback_query.from_user.id
+2 -2
View File
@@ -46,8 +46,8 @@ async def send_message_with_deletion(
return sent_message
@router.callback_query(F.data == "replenish_balance")
async def process_callback_replenish_balance(
@router.callback_query(F.data == "pay_stars")
async def process_callback_pay_stars(
callback_query: types.CallbackQuery, state: FSMContext
):
tg_id = callback_query.from_user.id
+2 -2
View File
@@ -55,8 +55,8 @@ async def send_message_with_deletion(
return sent_message
@router.callback_query(F.data == "replenish_balance")
async def process_callback_replenish_balance(
@router.callback_query(F.data == "pay_yookassa")
async def process_callback_pay_yookassa(
callback_query: types.CallbackQuery, state: FSMContext
):
tg_id = callback_query.from_user.id
+25 -8
View File
@@ -7,7 +7,7 @@ from aiogram.utils.keyboard import InlineKeyboardBuilder
from loguru import logger
from bot import bot
from config import CHANNEL_URL, FREEKASSA_ENABLE, PAYMENT_METHOD, YOOKASSA_ENABLE
from config import CHANNEL_URL, CRYPTO_BOT_ENABLE, FREEKASSA_ENABLE, STARS_ENABLE, YOOKASSA_ENABLE
from database import get_balance, get_key_count, get_referral_stats
from handlers.texts import get_referral_link, invite_message_send, profile_message_send
@@ -41,15 +41,32 @@ async def process_callback_view_profile(
InlineKeyboardButton(text=" Устройство", callback_data="create_key"),
InlineKeyboardButton(text="📱 Мои устр-ва", callback_data="view_keys"),
)
if YOOKASSA_ENABLE or FREEKASSA_ENABLE:
if YOOKASSA_ENABLE:
builder.row(
InlineKeyboardButton(
text="💳 Пополнить баланс",
callback_data=(
"pay_freekassa"
if PAYMENT_METHOD == "freekassa"
else "replenish_balance"
),
text="💳 Пополнить баланс ЯКассой",
callback_data="pay_yookassa",
)
)
if FREEKASSA_ENABLE:
builder.row(
InlineKeyboardButton(
text="💳 Пополнить баланс Freekassa",
callback_data="pay_freekassa",
)
)
if CRYPTO_BOT_ENABLE:
builder.row(
InlineKeyboardButton(
text="💳 Пополнить баланс CryptoBot",
callback_data="pay_cryptobot",
)
)
if STARS_ENABLE:
builder.row(
InlineKeyboardButton(
text="💳 Пополнить баланс Звездами",
callback_data="pay_stars",
)
)
builder.row(