From b21b16b817945bae2df47be8e5bcfe23f00b3a99 Mon Sep 17 00:00:00 2001 From: dymik739 Date: Mon, 4 Sep 2023 21:34:33 +0300 Subject: [PATCH] auto-schedule-pro-v2: add initial support for MarkdownV2 --- modules/auto-schedule-pro-v2/main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/auto-schedule-pro-v2/main.py b/modules/auto-schedule-pro-v2/main.py index 2fe9f96..d2f1634 100644 --- a/modules/auto-schedule-pro-v2/main.py +++ b/modules/auto-schedule-pro-v2/main.py @@ -55,13 +55,13 @@ def generate_lesson_description(lesson, start_datetime, end_datetime, current_da if output_settings['date']: human_readable_date = get_human_readable_date(start_datetime, end_datetime, current_day, current_week) - result += f"Дата: {human_readable_date}\n" + result += f"*Дата*: {human_readable_date}\n" if output_settings['teacher']: - result += f"Викладач: {lesson['teacher']}\n" + result += f"*Викладач*: {lesson['teacher']}\n" if output_settings['link']: - result += f"Посилання на пару: {lesson['link']}" + result += f"*Посилання*: {lesson['link']}" return result @@ -161,7 +161,7 @@ def process(message, path): else: closest_lesson_time = min(schedule) - return "Актуальна пара: " + get_lesson_description(schedule, reference_time, closest_lesson_time, current_day, + return "*Актуальна пара*: " + get_lesson_description(schedule, reference_time, closest_lesson_time, current_day, current_week) elif base_command == "!пари": @@ -176,8 +176,8 @@ def process(message, path): lesson_list = [i for i in schedule if selected_day * 86400 <= i < (selected_day + 1) * 86400] - lesson_descriptions_list = ["Назва: " + get_lesson_description(schedule, reference_time, lesson_time, + lesson_descriptions_list = ["*Назва*: " + get_lesson_description(schedule, reference_time, lesson_time, current_day, current_week, overrides=preferences) for lesson_time in lesson_list] - return f"Пари у {WEEKDAYS_ACCUSATIVE[selected_day % 7]}:\n" + "\n\n".join(lesson_descriptions_list) + return f"__Пари у {WEEKDAYS_ACCUSATIVE[selected_day % 7]}__:\n" + "\n\n".join(lesson_descriptions_list)