refactor: clean up unused code and duplicate handlers
- Removed duplicate admin callback handlers from main.py (moved to admin_panel.py) - Removed unused methods from BotController (handle_admin_panel, handle_lottery_management, handle_conduct_lottery_admin, handle_conduct_lottery) - Removed unused keyboard methods from ui.py (get_lottery_management_keyboard, get_lottery_keyboard, get_conduct_lottery_keyboard) - Simplified IBotController interface to only essential methods - Simplified IKeyboardBuilder interface to only used methods - Fixed cmd_admin handler to directly show admin panel - Bot now uses centralized admin handlers from admin_panel.py
This commit is contained in:
@@ -130,30 +130,10 @@ class IBotController(ABC):
|
||||
"""Обработать команду /start"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def handle_admin_panel(self, callback):
|
||||
"""Обработать admin panel"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def handle_lottery_management(self, callback):
|
||||
"""Обработать управление розыгрышами"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def handle_conduct_lottery_admin(self, callback):
|
||||
"""Обработать выбор розыгрыша для проведения"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def handle_active_lotteries(self, callback):
|
||||
"""Обработать показ активных розыгрышей"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def handle_conduct_lottery(self, callback):
|
||||
"""Обработать проведение конкретного розыгрыша"""
|
||||
pass
|
||||
|
||||
|
||||
class IMessageFormatter(ABC):
|
||||
@@ -181,19 +161,4 @@ class IKeyboardBuilder(ABC):
|
||||
@abstractmethod
|
||||
def get_admin_keyboard(self):
|
||||
"""Получить админскую клавиатуру"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_lottery_keyboard(self, lottery_id: int, is_admin: bool):
|
||||
"""Получить клавиатуру для розыгрыша"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_lottery_management_keyboard(self):
|
||||
"""Получить клавиатуру управления розыгрышами"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_conduct_lottery_keyboard(self, lotteries: List[Lottery]):
|
||||
"""Получить клавиатуру для выбора розыгрыша для проведения"""
|
||||
pass
|
||||
Reference in New Issue
Block a user