- Introduced `DependenciesMiddleware` and `BlacklistMiddleware` for enhanced request handling across all routers. - Refactored admin handlers to utilize new middleware, improving access control and error handling. - Updated the `admin_router` to include middleware for access checks and streamlined the process of banning users. - Enhanced the structure of admin handler imports for better organization and maintainability. - Improved error handling in various admin functions to ensure robust user interactions.
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
"""Constants for private handlers"""
|
||
|
||
from typing import Final
|
||
|
||
# FSM States
|
||
FSM_STATES: Final[dict[str, str]] = {
|
||
"START": "START",
|
||
"SUGGEST": "SUGGEST",
|
||
"PRE_CHAT": "PRE_CHAT",
|
||
"CHAT": "CHAT"
|
||
}
|
||
|
||
# Button texts
|
||
BUTTON_TEXTS: Final[dict[str, str]] = {
|
||
"SUGGEST_POST": "📢Предложить свой пост",
|
||
"SAY_GOODBYE": "👋🏼Сказать пока!",
|
||
"LEAVE_CHAT": "Выйти из чата",
|
||
"RETURN_TO_BOT": "Вернуться в бота",
|
||
"WANT_STICKERS": "🤪Хочу стикеры",
|
||
"CONNECT_ADMIN": "📩Связаться с админами"
|
||
}
|
||
|
||
# Error messages
|
||
ERROR_MESSAGES: Final[dict[str, str]] = {
|
||
"UNSUPPORTED_CONTENT": (
|
||
'Я пока не умею работать с таким сообщением. '
|
||
'Пришли текст и фото/фоты(ы). А лучше перешли это сообщение админу @kerrad1\n'
|
||
'Мы добавим его к обработке если необходимо'
|
||
),
|
||
"STICKERS_LINK": "Хорошо, лови, добавить можно отсюда: https://t.me/addstickers/love_biysk"
|
||
}
|