From aca5ac5d2a909c30b9a003551552b6c1ab9d0971 Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Tue, 4 Oct 2016 10:20:17 +0100 Subject: [PATCH] Announce if start and end dates are the same, so a one-time scheduled announcement is possible. --- db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.py b/db.py index c565ce7..a0e32d6 100644 --- 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) -- 2.7.4