mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-02-09 05:30:29 +00:00
29 lines
766 B
Python
29 lines
766 B
Python
from typing import Optional
|
|
|
|
from aiogram.fsm.context import FSMContext
|
|
from aiogram.types import TelegramObject, Message, CallbackQuery
|
|
|
|
from app.states import RegistrationStates
|
|
|
|
|
|
def is_registration_process(event: TelegramObject, current_state: Optional[str]) -> bool:
|
|
registration_states = [
|
|
RegistrationStates.waiting_for_rules_accept.state,
|
|
RegistrationStates.waiting_for_referral_code.state
|
|
]
|
|
|
|
registration_callbacks = [
|
|
"rules_accept",
|
|
"rules_decline",
|
|
"referral_skip"
|
|
]
|
|
|
|
if current_state in registration_states:
|
|
return True
|
|
|
|
if (isinstance(event, CallbackQuery)
|
|
and event.data
|
|
and event.data in registration_callbacks):
|
|
return True
|
|
|
|
return False |