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:
2025-11-17 08:00:39 +09:00
parent 0fdf01d1c7
commit 43d46ea6f8
5 changed files with 21 additions and 202 deletions

View File

@@ -37,19 +37,10 @@ class KeyboardBuilderImpl(IKeyboardBuilder):
[InlineKeyboardButton(text="🔙 Назад", callback_data="back_to_main")]
]
return InlineKeyboardMarkup(inline_keyboard=buttons)
def get_lottery_management_keyboard(self):
"""Получить клавиатуру управления розыгрышами"""
buttons = [
[InlineKeyboardButton(text=" Создать розыгрыш", callback_data="admin_create_lottery")],
[InlineKeyboardButton(text="📝 Редактировать розыгрыш", callback_data="admin_edit_lottery")],
[InlineKeyboardButton(text="🎭 Настройка отображения победителей", callback_data="admin_winner_display_settings")],
[InlineKeyboardButton(text="📋 Список всех розыгрышей", callback_data="admin_list_all_lotteries")],
[InlineKeyboardButton(text="<EFBFBD> Завершить розыгрыш", callback_data="admin_finish_lottery")],
[InlineKeyboardButton(text="<EFBFBD> Удалить розыгрыш", callback_data="admin_delete_lottery")],
[InlineKeyboardButton(text="🔙 Назад", callback_data="admin_panel")]
]
return InlineKeyboardMarkup(inline_keyboard=buttons)
class MessageFormatterImpl(IMessageFormatter):
"""Реализация форматирования сообщений"""
def get_lottery_keyboard(self, lottery_id: int, is_admin: bool = False):
"""Получить клавиатуру для конкретного розыгрыша"""