From 6f9be1606a1d1ee0db60bf1f35a8b04735482a73 Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Mon, 26 Nov 2018 15:01:44 +0100 Subject: [PATCH] Allow unscheduled tracks to use now/next PTGbot used to reject now/next (and location) commands for tracks that do not have a room scheduled on the same day. However, it is sometimes useful for teams to indicate such a message (double-booked rooms, team photo time, etc), so PTGbot will now issue a warning rather than reject command. Change-Id: Ib04fbf860b22a3b2e99b106f4f83ae702dd215d8 --- ptgbot/bot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ptgbot/bot.py b/ptgbot/bot.py index 08997ac..ced2434 100644 --- a/ptgbot/bot.py +++ b/ptgbot/bot.py @@ -124,11 +124,6 @@ class PTGBot(SASL, SSL, irc.bot.SingleServerIRCBot): adverb = words[1].lower() params = str.join(' ', words[2:]) - if adverb in ['now', 'next', 'location']: - if not self.data.get_track_room(track): - self.send(chan, "%s: track '%s' is not scheduled today" % - (nick, track)) - return if adverb == 'now': self.data.add_now(track, params) elif adverb == 'next': @@ -164,6 +159,11 @@ class PTGBot(SASL, SSL, irc.bot.SingleServerIRCBot): "Did you mean: %s now %s... ?" % (nick, adverb, track, adverb)) return + if adverb in ['now', 'next']: + if not self.data.get_track_room(track): + self.send(chan, "%s: message added, but please note that " + "track '%s' does not appear to have a room " + "scheduled today." % (nick, track)) if msg.startswith('~'): if not self.channels[chan].is_oper(nick):