cosmicbot/commands/wordcount.py

9 lines
355 B
Python

import plugin, subprocess
unhighlight_nick = lambda nick: "_{!s}_".format(nick)
@plugin.command("wordcount","<username>")
def wordcount(bot,channel,nick,user):
output = subprocess.check_output(["/usr/local/bin/wordcount",user]).decode("utf-8").strip()
bot.say(channel,nick+": "+unhighlight_nick(user)+" has written "+output+" words on cosmic.voyage")