Disable les reminder

pull/10/head
Stijn De Clercq 2020-12-11 21:47:14 +01:00
parent 110ab575b9
commit 13ce50f4fa
2 changed files with 6 additions and 2 deletions

View File

@ -189,6 +189,10 @@ class Tasks(commands.Cog):
weekday = self.getCurrentWeekday() weekday = self.getCurrentWeekday()
for category in reminders.categories: for category in reminders.categories:
# Check if this reminder is temporarily disabled
if category["disabled"]:
continue
# Checks if this reminder can be sent on weekdays # Checks if this reminder can be sent on weekdays
if (not category["weekends"]) and weekday > 4: if (not category["weekends"]) and weekday > 4:
continue continue

View File

@ -8,11 +8,11 @@ class Reminders:
self._nightlyUsers = [int(user[0]) for user in rows if user[1]] 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!"] self._nightlyMessages = ["Dagelijkse herinnering om Didier Nightly te doen.", "Vrees niet, Nightly-streak-liefhebber! 't Zenne kik, Didier, me ne reminder!"]
self.nightly = {"users": self._nightlyUsers, "messages": self._nightlyMessages, "weekends": True} 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._les = [int(user[0]) for user in rows if user[2]]
self._lesMessages = ["Lessenrooster voor vandaag:"] self._lesMessages = ["Lessenrooster voor vandaag:"]
self.les = {"users": self._les, "messages": self._lesMessages, "embed": self.lesEmbed(), "weekends": False} self.les = {"users": self._les, "messages": self._lesMessages, "embed": self.lesEmbed(), "weekends": False, "disabled": True}
self.categories = [self.nightly, self.les] self.categories = [self.nightly, self.les]