sopel-plugins/stats.py

14 lines
337 B
Python

# stattystyki a podstawie chanlogs
from sopel import plugin, tools
import os
@plugin.command('stats', 'staty')
@plugin.action_command('stat')
def stats(bot, trigger):
day = query.strip()
cmd = "cut -f 2 -d '*' /home/pybot/chanlogs/knajpa-2023-" + day + ".log | grep [/n] | wc -l"
answer=os.system(cmd)
bot.say(answer)