mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Ignore blocking loop
This commit is contained in:
parent
2d7eb5512d
commit
074f3861a5
1 changed files with 10 additions and 4 deletions
|
@ -140,10 +140,16 @@ class TimeTableCog(commands.Cog):
|
||||||
if not lesson:
|
if not lesson:
|
||||||
next_lesson = self.next_lesson(date)
|
next_lesson = self.next_lesson(date)
|
||||||
if not next_lesson:
|
if not next_lesson:
|
||||||
next_lesson = await asyncio.to_thread(
|
# next_lesson = await asyncio.to_thread(
|
||||||
self.absolute_next_lesson,
|
# self.absolute_next_lesson,
|
||||||
new_method=True
|
# new_method=True
|
||||||
)
|
# )
|
||||||
|
next_lesson = {
|
||||||
|
"name": "unknown",
|
||||||
|
"tutor": "unknown",
|
||||||
|
"room": "unknown",
|
||||||
|
"start_datetime": datetime.max
|
||||||
|
}
|
||||||
text = "[tt] No more lessons today!\n" \
|
text = "[tt] No more lessons today!\n" \
|
||||||
f"[tt] Next Lesson: {next_lesson['name']!r} with {next_lesson['tutor']} in " \
|
f"[tt] Next Lesson: {next_lesson['name']!r} with {next_lesson['tutor']} in " \
|
||||||
f"{next_lesson['room']} - " \
|
f"{next_lesson['room']} - " \
|
||||||
|
|
Loading…
Reference in a new issue