add timers 1 2 3 6 12 24 hours
This commit is contained in:
parent
13a83b9fbd
commit
3f5f4f14b9
2 changed files with 18 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue