git://git.furryclan.net
/
furrycat
/
catbot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8ef2f1
)
Return True if maybe_say() said something.
author
CMDR furrycat
<elite@furrycat.net>
Wed, 28 Sep 2016 12:52:13 +0000
(13:52 +0100)
committer
CMDR furrycat
<elite@furrycat.net>
Wed, 28 Sep 2016 12:52:13 +0000
(13:52 +0100)
bot.py
patch
|
blob
|
history
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):