From 323670495a7086dc5e83c9e28e53d6bc9c13a2ec Mon Sep 17 00:00:00 2001 From: nex <53234499+EEKIM10@users.noreply.github.com> Date: Thu, 20 Oct 2022 11:01:21 +0100 Subject: [PATCH] Add next lesson preview to timetable system --- cogs/timetable.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cogs/timetable.py b/cogs/timetable.py index afbeb84..e2b5874 100644 --- a/cogs/timetable.py +++ b/cogs/timetable.py @@ -108,6 +108,12 @@ class TimeTableCog(commands.Cog): else: text = f"[tt] Current Lesson: {lesson['name']!r} with {lesson['tutor']} in {lesson['room']} - " \ f"ends {discord.utils.format_dt(lesson['end_datetime'], 'R')}" + next_lesson = self.next_lesson(date) + if next_lesson: + text += "\n[tt]Next lesson: {0[name]!r] with {0[tutor]} in {0[room]} - starts {1}".format( + next_lesson, + next_lesson["start_datetime"] + ) if no_prefix: text = text.replace("[tt] ", "")