From: CMDR furrycat Date: Wed, 28 Sep 2016 12:52:13 +0000 (+0100) Subject: Return True if maybe_say() said something. X-Git-Url: http://git.furryclan.net/?a=commitdiff_plain;h=987090deaa74dce419d7ec6692b731dc8d632294;p=furrycat%2Fcatbot.git Return True if maybe_say() said something. --- diff --git a/bot.py b/bot.py index e91d9c0..57eb601 100755 --- 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):