Enhance private handlers structure and add database support
- Introduced a new `PrivateHandlers` class to encapsulate private message handling logic, improving organization and maintainability. - Added new dependencies in `requirements.txt` for database support with `aiosqlite`. - Updated the private handlers to utilize modular components for better separation of concerns and easier testing. - Implemented error handling and logging for improved robustness in message processing.
This commit is contained in:
29
helper_bot/handlers/private/constants.py
Normal file
29
helper_bot/handlers/private/constants.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Constants for private handlers"""
|
||||
|
||||
# FSM States
|
||||
FSM_STATES = {
|
||||
"START": "START",
|
||||
"SUGGEST": "SUGGEST",
|
||||
"PRE_CHAT": "PRE_CHAT",
|
||||
"CHAT": "CHAT"
|
||||
}
|
||||
|
||||
# Button texts
|
||||
BUTTON_TEXTS = {
|
||||
"SUGGEST_POST": "📢Предложить свой пост",
|
||||
"SAY_GOODBYE": "👋🏼Сказать пока!",
|
||||
"LEAVE_CHAT": "Выйти из чата",
|
||||
"RETURN_TO_BOT": "Вернуться в бота",
|
||||
"WANT_STICKERS": "🤪Хочу стикеры",
|
||||
"CONNECT_ADMIN": "📩Связаться с админами"
|
||||
}
|
||||
|
||||
# Error messages
|
||||
ERROR_MESSAGES = {
|
||||
"UNSUPPORTED_CONTENT": (
|
||||
'Я пока не умею работать с таким сообщением. '
|
||||
'Пришли текст и фото/фоты(ы). А лучше перешли это сообщение админу @kerrad1\n'
|
||||
'Мы добавим его к обработке если необходимо'
|
||||
),
|
||||
"STICKERS_LINK": "Хорошо, лови, добавить можно отсюда: https://t.me/addstickers/love_biysk"
|
||||
}
|
||||
Reference in New Issue
Block a user