- 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.
48 lines
899 B
Python
48 lines
899 B
Python
"""Group handlers package for Telegram bot"""
|
|
|
|
# Local imports - main components
|
|
from .group_handlers import (
|
|
group_router,
|
|
create_group_handlers,
|
|
GroupHandlers
|
|
)
|
|
|
|
# Local imports - services
|
|
from .services import (
|
|
AdminReplyService,
|
|
DatabaseProtocol
|
|
)
|
|
|
|
# Local imports - constants and utilities
|
|
from .constants import (
|
|
FSM_STATES,
|
|
ERROR_MESSAGES
|
|
)
|
|
from .exceptions import (
|
|
NoReplyToMessageError,
|
|
UserNotFoundError
|
|
)
|
|
from .decorators import error_handler
|
|
|
|
__all__ = [
|
|
# Main components
|
|
'group_router',
|
|
'create_group_handlers',
|
|
'GroupHandlers',
|
|
|
|
# Services
|
|
'AdminReplyService',
|
|
'DatabaseProtocol',
|
|
|
|
# Constants
|
|
'FSM_STATES',
|
|
'ERROR_MESSAGES',
|
|
|
|
# Exceptions
|
|
'NoReplyToMessageError',
|
|
'UserNotFoundError',
|
|
|
|
# Utilities
|
|
'error_handler'
|
|
]
|