seperate messages for numeric vs non latest

This commit is contained in:
James Tomasino 2019-02-04 19:38:04 -05:00
parent d7d69a17fa
commit 9f078d1442
1 changed files with 3 additions and 1 deletions

4
bot.py
View File

@ -77,7 +77,9 @@ class CosmicBot(teambot.Handler):
count = 1 # ...nice try, smartass
if count > 5:
count = 5 # don't spam the channel
self.say(channel, "{}: Latest {} {}. (See cosmic.voyage for more!)".format(nick, count, (count == 1 and "entry" or "entries")))
self.say(channel, "{}: Latest {} {}. (See cosmic.voyage for more!)".format(nick, count, (count == 1 and "entry" or "entries")))
else:
self.say(channel, "{}: Latest entries matching '{}'. (See cosmic.voyage for more!)".format(nick, count))
output = subprocess.check_output(["/usr/local/bin/latest",str(count)]).decode("ascii").split("\n")
output = filter(None,output)
for line in output: