didier/data/remind.py

24 lines
1.0 KiB
Python
Raw Normal View History

2020-10-23 22:12:05 +02:00
from functions import les
from functions.database import remind
class Reminders:
def __init__(self):
rows = remind.getAllRows()
self._nightlyUsers = [int(user[0]) for user in rows if user[1]]
self._nightlyMessages = ["Dagelijkse herinnering om Didier Nightly te doen.", "Vrees niet, Nightly-streak-liefhebber! 't Zenne kik, Didier, me ne reminder!"]
2020-12-11 21:47:14 +01:00
self.nightly = {"users": self._nightlyUsers, "messages": self._nightlyMessages, "weekends": True, "disabled": False}
self._les = [int(user[0]) for user in rows if user[2]]
self._lesMessages = ["Lessenrooster voor vandaag:"]
self.les = {"users": self._les, "messages": self._lesMessages, "embed": self.lesEmbed(), "weekends": False, "disabled": False}
self.categories = [self.nightly, self.les]
2020-10-23 22:12:05 +02:00
def lesEmbed(self):
day, dayDatetime, semester, year = les.parseArgs([])[1:]
schedule = les.getSchedule(semester, year)
return les.createEmbed(day, dayDatetime, semester, year, schedule)