cosmicbot/commands/wordcount.py

9 lines
355 B
Python
Raw Normal View History

2020-11-03 02:56:32 +00:00
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")