diff --git a/LichessClientTG_bot/bot.py b/LichessClientTG_bot/bot.py index f7e28a2..5dc71dd 100644 --- a/LichessClientTG_bot/bot.py +++ b/LichessClientTG_bot/bot.py @@ -756,7 +756,14 @@ class LichessBot: if period == 0: button_text = t('disable_notifications', lang) else: - button_text = t('period_minutes', lang, period=period) + # Format period text: minutes for < 60, hours for >= 60 + if period < 60: + button_text = f"ā° {period} minutes" + elif period == 60: + button_text = "ā° 1 hour" + else: + hours = period // 60 + button_text = f"ā° {hours} hours" keyboard.append([InlineKeyboardButton(button_text, callback_data=f"period_{period}")]) reply_markup = InlineKeyboardMarkup(keyboard) @@ -796,8 +803,16 @@ class LichessBot: t('notifications_disabled', lang, username=active_gamer['username']) ) else: + # Format period text for confirmation message + if period < 60: + period_text = f"{period} minutes" + elif period == 60: + period_text = "1 hour" + else: + hours = period // 60 + period_text = f"{hours} hours" await query.edit_message_text( - t('period_set', lang, period=period, username=active_gamer['username']) + f"āœ… Period {period_text} set for {active_gamer['username']}\nšŸ“± Notifications will be sent to personal messages" ) # Start periodic task for this gamer (send to user's personal messages) diff --git a/LichessClientTG_bot/config.py b/LichessClientTG_bot/config.py index 38d606a..7e811fa 100644 --- a/LichessClientTG_bot/config.py +++ b/LichessClientTG_bot/config.py @@ -31,7 +31,7 @@ def _resolve_database_path() -> str: DATABASE_PATH = _resolve_database_path() # Period options for /setperiod command -PERIOD_OPTIONS = [0, 15, 30, 60, 120, 180] # minutes +PERIOD_OPTIONS = [0, 15, 30, 60, 120, 180, 360, 720, 1440] # minutes (0=disable, then: 15min, 30min, 1h, 2h, 3h, 6h, 12h, 24h) # Telegram Bot Long Polling Configuration POLL_INTERVAL = 1.0 # seconds