Compare commits
No commits in common. "b0c1790e239c732f9aaaf5ad0e05b4309ca78ab7" and "c72fa396769ed157fec3b479eba5650e8e027d10" have entirely different histories.
b0c1790e23
...
c72fa39676
|
@ -8,7 +8,7 @@ if self.MESSAGE["text"].lower() == "!пара":
|
||||||
current_day = current_time.weekday()
|
current_day = current_time.weekday()
|
||||||
current_seconds = current_time.hour * 3600 + current_time.minute * 60 + current_time.second
|
current_seconds = current_time.hour * 3600 + current_time.minute * 60 + current_time.second
|
||||||
|
|
||||||
print(f"[DEBUG] Current day is {type(current_day)}({current_day})")
|
print("[DEBUG] Current day is {}({})".format(type(current_day), current_day))
|
||||||
if current_day > 4 or current_day < 0:
|
if current_day > 4 or current_day < 0:
|
||||||
next_week = int(not bool(current_week))
|
next_week = int(not bool(current_week))
|
||||||
day = -1
|
day = -1
|
||||||
|
@ -24,22 +24,19 @@ if self.MESSAGE["text"].lower() == "!пара":
|
||||||
pair_found = True
|
pair_found = True
|
||||||
break
|
break
|
||||||
|
|
||||||
self.RESPONCE = f"Сьогодні вихідний, тому пар немає)\n"\
|
self.RESPONCE = "Сьогодні вихідний, тому пар немає)\nНаступна пара - {} ({}) о {} у {}\nПосилання (якщо воно чомусь треба): {}".format(next_pair["subject"], next_pair["lector"], self.reverse_timetable[int(j)], self.days_rod[day], next_pair["link"])
|
||||||
f"Наступна пара - {next_pair['subject']} ({next_pair['lector']}) о {self.reverse_timetable[int(j)]} у {self.days_rod[day]}\n"\
|
|
||||||
f"Посилання (якщо воно чомусь треба): {next_pair['link']}"
|
|
||||||
else:
|
else:
|
||||||
for i in self.timetable:
|
for i in self.timetable:
|
||||||
if current_seconds < i:
|
if current_seconds < i:
|
||||||
print("[DEBUG] Looking up a relevant pair...")
|
print("[DEBUG] Looking up a relevant pair...")
|
||||||
try:
|
try:
|
||||||
relevant_pair = schedule[current_week][current_day][str(self.timetable[i])]
|
relevant_pair = schedule[current_week][current_day][str(self.timetable[i])]
|
||||||
self.RESPONCE = f"Актуальна пара: {relevant_pair['subject']} ({relevant_pair['lector']}), початок о {self.reverse_timetable[self.timetable[i]]}\n"\
|
self.RESPONCE = "Актуальна пара: {} ({}), початок о {}\nПосилання: {}".format(relevant_pair["subject"], relevant_pair["lector"], self.reverse_timetable[self.timetable[i]], relevant_pair["link"])
|
||||||
f"Посилання: {relevant_pair['link']}"
|
|
||||||
break
|
break
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[WARN] module: auto-schedule: exception {e} while looking up the pair")
|
print("[WARN] module: auto-schedule: exception {} while looking up the pair".format(e))
|
||||||
else:
|
else:
|
||||||
self.RESPONCE = "Сьогодні більше немає пар"
|
self.RESPONCE = "Сьогодні більше немає пар"
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[WARN] module: auto-schedule: failed to process schedule.json ({e})")
|
print("[WARN] module: auto-schedule: failed to process schedule.json ({})".format(e))
|
||||||
|
|
Loading…
Reference in New Issue