Add next lesson preview to timetable system

This commit is contained in:
nex 2022-10-20 11:01:21 +01:00
parent 6b5da04ff4
commit 323670495a

View file

@ -108,6 +108,12 @@ class TimeTableCog(commands.Cog):
else: else:
text = f"[tt] Current Lesson: {lesson['name']!r} with {lesson['tutor']} in {lesson['room']} - " \ text = f"[tt] Current Lesson: {lesson['name']!r} with {lesson['tutor']} in {lesson['room']} - " \
f"ends {discord.utils.format_dt(lesson['end_datetime'], 'R')}" 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: if no_prefix:
text = text.replace("[tt] ", "") text = text.replace("[tt] ", "")