Start date must be equal to or before end date.
authorCMDR furrycat <elite@furrycat.net>
Wed, 12 Oct 2016 20:46:43 +0000 (21:46 +0100)
committerCMDR furrycat <elite@furrycat.net>
Wed, 12 Oct 2016 20:46:43 +0000 (21:46 +0100)
bot.py

diff --git a/bot.py b/bot.py
index 75d4c19..35f454d 100755 (executable)
--- a/bot.py
+++ b/bot.py
@@ -1259,6 +1259,11 @@ def create_announcement(message, raw):
     server = channel.server
     create['server_id'] = server.id
 
+  if 'start_date' in create and 'end_date' in create:
+    if create['start_date'] > create['end_date']:
+      yield from say(message.channel, "Start date must not be before end date!")
+      return
+
   announce = yield from can_manage_announcements(message.author, message.channel, 'create', create = create)
   if not announce:
     return