Return True if maybe_say() said something.
authorCMDR furrycat <elite@furrycat.net>
Wed, 28 Sep 2016 12:52:13 +0000 (13:52 +0100)
committerCMDR furrycat <elite@furrycat.net>
Wed, 28 Sep 2016 12:52:13 +0000 (13:52 +0100)
bot.py

diff --git a/bot.py b/bot.py
index e91d9c0..57eb601 100755 (executable)
--- a/bot.py
+++ b/bot.py
@@ -89,12 +89,15 @@ def maybe_say(channel, text, probability = 0.2):
   if random.random() <= probability:
     yield from client.send_typing(channel)
     yield from client.send_message(channel, text)
+    return True
   else:
     log.debug("Didn't bother to say {}".format(text))
+    return False
 
 @asyncio.coroutine
 def say(channel, text):
   yield from maybe_say(channel, text, 1.0)
+  return True
 
 @asyncio.coroutine
 def say_expect(message, stdout):