auto-schedule-pro-v2, auto-schedule-pro: switch to calling new module by default
This commit is contained in:
parent
56e57c4d7f
commit
edfcc6e1be
|
@ -126,7 +126,7 @@ def process(message, path):
|
||||||
# one printable symbol, so this is already protected
|
# one printable symbol, so this is already protected
|
||||||
base_command = full_command[0].lower()
|
base_command = full_command[0].lower()
|
||||||
|
|
||||||
if base_command not in ["!пара-beta", "!пари-beta"]:
|
if base_command not in ["!пара", "!пари"]:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
global module_path
|
global module_path
|
||||||
|
@ -146,7 +146,7 @@ def process(message, path):
|
||||||
|
|
||||||
reference_time = int(current_time.strftime("%s")) - current_seconds
|
reference_time = int(current_time.strftime("%s")) - current_seconds
|
||||||
|
|
||||||
if base_command == "!пара-beta":
|
if base_command == "!пара":
|
||||||
upcoming_lessons = [timestamp for timestamp in schedule if timestamp > current_seconds-5400]
|
upcoming_lessons = [timestamp for timestamp in schedule if timestamp > current_seconds-5400]
|
||||||
|
|
||||||
if len(upcoming_lessons) > 0:
|
if len(upcoming_lessons) > 0:
|
||||||
|
@ -158,7 +158,7 @@ def process(message, path):
|
||||||
closest_lesson_time, current_day,
|
closest_lesson_time, current_day,
|
||||||
current_week)
|
current_week)
|
||||||
|
|
||||||
elif base_command == "!пари-beta":
|
elif base_command == "!пари":
|
||||||
base_day = current_week*7 + current_day
|
base_day = current_week*7 + current_day
|
||||||
|
|
||||||
if len(full_command) >= 2:
|
if len(full_command) >= 2:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
## code ##
|
## code ##
|
||||||
if (self.MESSAGE["text"].lower() == "!пара" or self.MESSAGE["text"].lower().split()[0] == "!пари"):
|
if (self.MESSAGE["text"].lower() == "!пара-old2" or self.MESSAGE["text"].lower().split()[0] == "!пари-old2"):
|
||||||
|
|
||||||
#getting current time
|
#getting current time
|
||||||
current_time = datetime.datetime.now()
|
current_time = datetime.datetime.now()
|
||||||
|
@ -31,7 +31,7 @@ if (self.MESSAGE["text"].lower() == "!пара" or self.MESSAGE["text"].lower().
|
||||||
|
|
||||||
full_schedule = dict(list(schedule.items()) + list(additions.items()))
|
full_schedule = dict(list(schedule.items()) + list(additions.items()))
|
||||||
|
|
||||||
if self.MESSAGE["text"].lower() == "!пара":
|
if self.MESSAGE["text"].lower() == "!пара-old2":
|
||||||
print("test1")
|
print("test1")
|
||||||
print(f"Full schedule printout: {full_schedule}")
|
print(f"Full schedule printout: {full_schedule}")
|
||||||
print(f"Current delta_time: {current_seconds}")
|
print(f"Current delta_time: {current_seconds}")
|
||||||
|
@ -108,7 +108,7 @@ if self.MESSAGE["text"].lower() == "!пара":
|
||||||
|
|
||||||
self.RESPONCE = "Актуальна пара: {}\nДата: {}\nВикладач: {}\nПосилання на пару: {}".format(p['name'], human_readable_date, p['teacher'], p['link'])
|
self.RESPONCE = "Актуальна пара: {}\nДата: {}\nВикладач: {}\nПосилання на пару: {}".format(p['name'], human_readable_date, p['teacher'], p['link'])
|
||||||
|
|
||||||
if self.MESSAGE["text"].lower().split()[0] == "!пари":
|
if self.MESSAGE["text"].lower().split()[0] == "!пари-old2":
|
||||||
command = self.MESSAGE["text"].lower().split()
|
command = self.MESSAGE["text"].lower().split()
|
||||||
|
|
||||||
preferences = {"name": True, "date": True, "teacher": True, "link": True}
|
preferences = {"name": True, "date": True, "teacher": True, "link": True}
|
||||||
|
|
Loading…
Reference in New Issue