From e4011db2fe63e2175a73a373d0b3f0af684c5656 Mon Sep 17 00:00:00 2001 From: Sergey Bahmatov Date: Sat, 29 Mar 2025 09:08:37 +0500 Subject: [PATCH] logs --- pomodoro_bot/bot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pomodoro_bot/bot.py b/pomodoro_bot/bot.py index 662ff92..d8c2a20 100644 --- a/pomodoro_bot/bot.py +++ b/pomodoro_bot/bot.py @@ -34,18 +34,19 @@ async def on_startup(dispatcher): @dispatcher.callback_query_handler(lambda call: call.data.startswith("action_")) async def handle_callback(call: types.CallbackQuery): print(f"[DEBUG handle_callback] Received call.data: {call.data!r}") + print(f"[DEBUG handle_callback] call.data repr: {repr(call.data)}") timer_manager = dispatcher['timer_manager'] - if call.data == "action_pomodoro": + if "pomodoro" in call.data: await timer_manager.start_timer(call.from_user.id, 25*60, call.message.chat.id, 'Pomodoro') await call.message.answer("Начался 25-минутный Pomodoro! 🔥") - elif call.data == "action_shortbreak": + elif "shortbreak" in call.data: await timer_manager.start_timer(call.from_user.id, 5*60, call.message.chat.id, 'Short Break') await call.message.answer("Начался 5-минутный перерыв ☕") - elif call.data == "action_longbreak": + elif "longbreak" in call.data: await timer_manager.start_timer(call.from_user.id, 15*60, call.message.chat.id, 'Long Break') await call.message.answer("Начался длинный перерыв 😌") - elif call.data == "action_stop": + elif "stop" in call.data: await timer_manager.stop_timer(call.from_user.id) await call.message.answer("Таймер остановлен ⏹") await call.answer()