Fix up !latest
This commit is contained in:
parent
f837cdfe6d
commit
2a7cdebbe5
4
bot.py
4
bot.py
|
@ -78,10 +78,10 @@ class CosmicBot(teambot.Handler):
|
||||||
if count > 5:
|
if count > 5:
|
||||||
count = 5 # don't spam the channel
|
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")))
|
||||||
output = subprocess.check_output(["/usr/local/bin/latest",str(count)).decode("ascii").split("\n")
|
output = subprocess.check_output(["/usr/local/bin/latest",str(count)]).decode("ascii").split("\n")
|
||||||
output = filter(None,output)
|
output = filter(None,output)
|
||||||
for line in output:
|
for line in output:
|
||||||
self.say(channel,"{}{})".format(nick,line))
|
self.say(channel,"{}: {}".format(nick,line))
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
channels = "#cosmic".split()
|
channels = "#cosmic".split()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user