From 6f5ec883f0b619f5e80f7d663df84cf1102dcab6 Mon Sep 17 00:00:00 2001 From: Vladless Date: Sat, 29 Mar 2025 02:15:52 +0300 Subject: [PATCH] format text --- handlers/notifications/general_notifications.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/handlers/notifications/general_notifications.py b/handlers/notifications/general_notifications.py index c94e17df..28d21aef 100644 --- a/handlers/notifications/general_notifications.py +++ b/handlers/notifications/general_notifications.py @@ -323,11 +323,13 @@ async def handle_expired_keys(bot: Bot, conn: asyncpg.Connection, current_time: if hours > 0: if minutes > 0: - delay_message = KEY_EXPIRED_DELAY_HOURS_MINUTES_MSG.format( - email=email, hours=hours, minutes=minutes - ) + hour_suffix = "час" if hours == 1 else "часа" if 2 <= hours <= 4 else "часов" + time_str = f"{hours} {hour_suffix} и {minutes} минут" + delay_message = KEY_EXPIRED_DELAY_HOURS_MINUTES_MSG.format(email=email, time_str=time_str) else: - delay_message = KEY_EXPIRED_DELAY_HOURS_MSG.format(email=email, hours=hours) + hour_suffix = "час" if hours == 1 else "часа" if 2 <= hours <= 4 else "часов" + time_str = f"{hours} {hour_suffix}" + delay_message = KEY_EXPIRED_DELAY_HOURS_MSG.format(email=email, time_str=time_str) else: delay_message = KEY_EXPIRED_DELAY_MINUTES_MSG.format(email=email, minutes=NOTIFY_DELETE_DELAY) else: