forked from FOSS/AutoShop-Djimbo
refactor: remove Yoomoney payment integration
This commit is contained in:
+23
-18
@@ -14,21 +14,20 @@ from tgbot.utils.text_functions import position_open_user
|
||||
|
||||
# Игнор-колбэки покупок
|
||||
prohibit_buy = (
|
||||
'buy_category_swipe',
|
||||
'buy_category_open',
|
||||
'buy_position_swipe',
|
||||
'buy_position_open',
|
||||
'buy_item_open',
|
||||
'buy_item_confirm',
|
||||
"buy_category_swipe",
|
||||
"buy_category_open",
|
||||
"buy_position_swipe",
|
||||
"buy_position_open",
|
||||
"buy_item_open",
|
||||
"buy_item_confirm",
|
||||
)
|
||||
|
||||
# Игнор-колбэки пополнений
|
||||
prohibit_refill = (
|
||||
'user_refill',
|
||||
'user_refill_method',
|
||||
'Pay:Cryptobot',
|
||||
'Pay:Yoomoney',
|
||||
'Pay:',
|
||||
"user_refill",
|
||||
"user_refill_method",
|
||||
"Pay:Cryptobot",
|
||||
"Pay:",
|
||||
)
|
||||
|
||||
router = Router(name=__name__)
|
||||
@@ -54,7 +53,9 @@ async def filter_work_message(message: Message, bot: Bot, state: FSM, arSession:
|
||||
|
||||
# Фильтр на технические работы - колбэк
|
||||
@router.callback_query(IsWork())
|
||||
async def filter_work_callback(call: CallbackQuery, bot: Bot, state: FSM, arSession: ARS):
|
||||
async def filter_work_callback(
|
||||
call: CallbackQuery, bot: Bot, state: FSM, arSession: ARS
|
||||
):
|
||||
await state.clear()
|
||||
|
||||
await call.answer("⛔ Бот находится на технических работах.", True)
|
||||
@@ -64,7 +65,7 @@ async def filter_work_callback(call: CallbackQuery, bot: Bot, state: FSM, arSess
|
||||
################################# СТАТУС ПОКУПОК ###############################
|
||||
# Фильтр на доступность покупок - сообщение
|
||||
@router.message(IsBuy(), F.text == "🎁 Купить")
|
||||
@router.message(IsBuy(), StateFilter('here_item_count'))
|
||||
@router.message(IsBuy(), StateFilter("here_item_count"))
|
||||
async def filter_buy_message(message: Message, bot: Bot, state: FSM, arSession: ARS):
|
||||
await state.clear()
|
||||
|
||||
@@ -73,7 +74,9 @@ async def filter_buy_message(message: Message, bot: Bot, state: FSM, arSession:
|
||||
|
||||
# Фильтр на доступность покупок - колбэк
|
||||
@router.callback_query(IsBuy(), F.data.startswith(prohibit_buy))
|
||||
async def filter_buy_callback(call: CallbackQuery, bot: Bot, state: FSM, arSession: ARS):
|
||||
async def filter_buy_callback(
|
||||
call: CallbackQuery, bot: Bot, state: FSM, arSession: ARS
|
||||
):
|
||||
await state.clear()
|
||||
|
||||
await call.answer("⛔ Покупки временно отключены.", True)
|
||||
@@ -82,7 +85,7 @@ async def filter_buy_callback(call: CallbackQuery, bot: Bot, state: FSM, arSessi
|
||||
################################################################################
|
||||
############################### СТАТУС ПОПОЛНЕНИЙ ##############################
|
||||
# Фильтр на доступность пополнения - сообщение
|
||||
@router.message(IsRefill(), StateFilter('here_refill_amount'))
|
||||
@router.message(IsRefill(), StateFilter("here_refill_amount"))
|
||||
async def filter_refill_message(message: Message, bot: Bot, state: FSM, arSession: ARS):
|
||||
await state.clear()
|
||||
|
||||
@@ -91,7 +94,9 @@ async def filter_refill_message(message: Message, bot: Bot, state: FSM, arSessio
|
||||
|
||||
# Фильтр на доступность пополнения - колбэк
|
||||
@router.callback_query(IsRefill(), F.data.startswith(prohibit_refill))
|
||||
async def filter_refill_callback(call: CallbackQuery, bot: Bot, state: FSM, arSession: ARS):
|
||||
async def filter_refill_callback(
|
||||
call: CallbackQuery, bot: Bot, state: FSM, arSession: ARS
|
||||
):
|
||||
await state.clear()
|
||||
|
||||
await call.answer("⛔ Пополнение временно отключено.", True)
|
||||
@@ -100,7 +105,7 @@ async def filter_refill_callback(call: CallbackQuery, bot: Bot, state: FSM, arSe
|
||||
################################################################################
|
||||
#################################### ПРОЧЕЕ ####################################
|
||||
# Открытие главного меню
|
||||
@router.message(F.text.in_(('🔙 Главное меню', '/start')))
|
||||
@router.message(F.text.in_(("🔙 Главное меню", "/start")))
|
||||
async def main_start(message: Message, bot: Bot, state: FSM, arSession: ARS):
|
||||
await state.clear()
|
||||
|
||||
@@ -115,7 +120,7 @@ async def main_start(message: Message, bot: Bot, state: FSM, arSession: ARS):
|
||||
|
||||
|
||||
# Открытие диплинков
|
||||
@router.message(F.text.startswith('/start '))
|
||||
@router.message(F.text.startswith("/start "))
|
||||
async def main_start_deeplink(message: Message, bot: Bot, state: FSM, arSession: ARS):
|
||||
deepling_args = message.text[7:]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user