Announce if start and end dates are the same, so a one-time scheduled announcement...
authorCMDR furrycat <elite@furrycat.net>
Tue, 4 Oct 2016 09:20:17 +0000 (10:20 +0100)
committerCMDR furrycat <elite@furrycat.net>
Tue, 4 Oct 2016 09:20:17 +0000 (10:20 +0100)
db.py

diff --git a/db.py b/db.py
index c565ce7..a0e32d6 100644 (file)
--- a/db.py
+++ b/db.py
@@ -60,7 +60,7 @@ class DBConnection(object):
 
   def get_announcements(self, client):
     now = self.now()
-    cursor = self.query('select id, server_id, channel_id, voice_id, sound, mention, start_date, end_date, interval, probability, last_spoke, message, digest from announcements where (start_date is null or start_date <= ?) and (end_date is null or end_date > ?) and (last_spoke is null or last_spoke < ? - interval) and bot_id=?', [now, now, now, client.user.id])
+    cursor = self.query('select id, server_id, channel_id, voice_id, sound, mention, start_date, end_date, interval, probability, last_spoke, message, digest from announcements where (start_date is null or start_date <= ?) and (end_date is null or end_date > ? or end_date=start_date) and (last_spoke is null or last_spoke < ? - interval) and bot_id=?', [now, now, now, client.user.id])
     for row in cursor.fetchall():
       yield dict(row)