ASAP announcements might not play.
authorCMDR furrycat <elite@furrycat.net>
Fri, 4 Nov 2016 22:35:45 +0000 (22:35 +0000)
committerCMDR furrycat <elite@furrycat.net>
Fri, 4 Nov 2016 22:35:45 +0000 (22:35 +0000)
plugin/announcements/announcements.py

index 648936c..70d4490 100644 (file)
@@ -859,7 +859,10 @@ class Announcements(DBConnection):
           else:
             log.info('Dryrun: Not posting announcement {} to {}: {}'.format(announcement['id'], channel, logtext))
       else:
-        announce = random.random() <= announcement['probability'] if not already_posted else 0
+        announce = False
+        if not already_posted:
+          if random.random() <= announcement['probability']:
+            announce = True
         if announce:
           if voice_only:
             yield from bot.wake_up()