Add notification settings
This commit is contained in:
@@ -40,3 +40,45 @@ def get_marathon_details_keyboard(marathon_id: int) -> InlineKeyboardMarkup:
|
||||
]
|
||||
|
||||
return InlineKeyboardMarkup(inline_keyboard=buttons)
|
||||
|
||||
|
||||
def get_settings_keyboard(settings: dict) -> InlineKeyboardMarkup:
|
||||
"""Create keyboard for notification settings."""
|
||||
# Get current values with defaults
|
||||
notify_events = settings.get("notify_events", True)
|
||||
notify_disputes = settings.get("notify_disputes", True)
|
||||
notify_moderation = settings.get("notify_moderation", True)
|
||||
|
||||
# Status indicators
|
||||
events_status = "✅" if notify_events else "❌"
|
||||
disputes_status = "✅" if notify_disputes else "❌"
|
||||
moderation_status = "✅" if notify_moderation else "❌"
|
||||
|
||||
buttons = [
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text=f"{events_status} События (Golden Hour, Jackpot...)",
|
||||
callback_data="toggle:notify_events"
|
||||
)
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text=f"{disputes_status} Споры",
|
||||
callback_data="toggle:notify_disputes"
|
||||
)
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text=f"{moderation_status} Модерация (игры/челленджи)",
|
||||
callback_data="toggle:notify_moderation"
|
||||
)
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="◀️ Назад",
|
||||
callback_data="back_to_menu"
|
||||
)
|
||||
]
|
||||
]
|
||||
|
||||
return InlineKeyboardMarkup(inline_keyboard=buttons)
|
||||
|
||||
Reference in New Issue
Block a user