mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-01-29 08:10:24 +00:00
- Add pyproject.toml with uv and ruff configuration - Pin Python version to 3.13 via .python-version - Add Makefile commands: lint, format, fix - Apply ruff formatting to entire codebase - Remove unused imports (base64 in yookassa/simple_subscription) - Update .gitignore for new config files
35 lines
977 B
Python
35 lines
977 B
Python
from aiogram.types import CallbackQuery, TelegramObject
|
|
|
|
from app.states import RegistrationStates
|
|
|
|
|
|
def is_registration_process(event: TelegramObject, current_state: str | None) -> bool:
|
|
registration_states = [
|
|
RegistrationStates.waiting_for_language.state,
|
|
RegistrationStates.waiting_for_rules_accept.state,
|
|
RegistrationStates.waiting_for_privacy_policy_accept.state,
|
|
RegistrationStates.waiting_for_referral_code.state,
|
|
]
|
|
|
|
registration_callbacks = [
|
|
'rules_accept',
|
|
'rules_decline',
|
|
'privacy_policy_accept',
|
|
'privacy_policy_decline',
|
|
'referral_skip',
|
|
]
|
|
|
|
language_select_prefix = 'language_select:'
|
|
|
|
if current_state in registration_states:
|
|
return True
|
|
|
|
if (
|
|
isinstance(event, CallbackQuery)
|
|
and event.data
|
|
and (event.data in registration_callbacks or event.data.startswith(language_select_prefix))
|
|
):
|
|
return True
|
|
|
|
return False
|