Add wrote command
This commit is contained in:
parent
6fb1ea1783
commit
81e962ed33
|
@ -0,0 +1,17 @@
|
|||
import plugin
|
||||
from dictdata import DictData
|
||||
|
||||
wrote = DictData("wrote.json")
|
||||
|
||||
def get_wordcount(nick):
|
||||
return wrote.get(nick,0)
|
||||
|
||||
@plugin.command("wrote")
|
||||
def wrote(bot,channel,nick,*args):
|
||||
args = list(args)
|
||||
if len(args)!=1:
|
||||
bot.say(channel,"Usage: !wrote <name/number>")
|
||||
if args.isdigit():
|
||||
wrote[nick]=get_wordcount(nick)+int(args[0])
|
||||
else:
|
||||
bot.say(channel,"{}: _{}_ has wrote {!s} words".format(nick,args[0],get_wordcount(args[0])))
|
Loading…
Reference in New Issue