From 265a329f2c0802fdd894758c4a02b18c42292a64 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 5 Mar 2026 13:43:35 +0800 Subject: [PATCH] fix: correct display time for snooze reminder in callback handler --- bot/handlers/callback.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/handlers/callback.py b/bot/handlers/callback.py index 97c9c46..e07dbda 100644 --- a/bot/handlers/callback.py +++ b/bot/handlers/callback.py @@ -1,5 +1,6 @@ from datetime import datetime, timedelta, timezone +import pytz from telegram import Update from telegram.ext import ContextTypes @@ -38,8 +39,10 @@ async def handle_callback(update: Update, context: ContextTypes.DEFAULT_TYPE) -> lambda ctx: execute_reminder(reminder_id, ctx.bot), when=snooze_time, ) + tz = pytz.timezone("Asia/Shanghai") + display_time = snooze_time.astimezone(tz).strftime('%H:%M') await query.edit_message_text( - f"⏰ 已延期10分钟,将在 {snooze_time.strftime('%H:%M')} 再次提醒。" + f"⏰ 已延期10分钟,将在 {display_time} 再次提醒。" ) elif action == "pause":