1 # Someone's Mattermost bot.
2 + Copyright (c) 2016-2022 by Someone <someone@somenet.org> (aka. Jan Vales <jan@jvales.net>)
3 + published under MIT-License
5 Started out as a simple means to lock channels into "read-only" mode by creating outgoing webhooks and deleting every incomming message.
6 + This code is long gone/rebased away.
8 Currently this bot's uses range from fun `/threads` `/order` to something helpful `/join-all` and to moderative features like `/ta-wipe-channel` or `/mod-del` and displays dialogs.
12 + pip3 install --user --upgrade -r requirements.txt
13 + create a config.py file from config.py.example.
14 + make systemd start this bot (see somebot.service)
15 + periodically run some cronjobs, like these:
19 */5 * * * * (XDG_RUNTIME_DIR=/run/user/1002 systemctl --user kill -s SIGUSR1 somebot.service) &> /dev/null
21 59 11 * * * (cd /srv/mattermost/mattermost-bot; python3 -u command_stats_printer.py | python3 -m mattermost.stdin2channel http://localhost:8065/api user pw channel '``AUTODELETE-DAY`` #command_usage #mmstats\n```\n' '\n```'; rm /tmp/somebot_command_stats.json) &> /dev/null