Slack bot for trolling karma.
In a slack channel I use there is a bot which has a karma module. Messaging the bot with "fubar++" or "fubar--" will add or subtract the karma value for fubar. This was created as a troll response to a "war" of sorts between perl and ruby developers in slack.
This docker image runs a ruby script to add positive karma to ruby and negitive karma to perl with a random sleep between 5 and 20 minutes. As to not just keep adding karma onces the war is won I had set a random limit on when to add karma. After initialization the script will add karma to ruby if it is less than a random number between 500 and 1000. Likewise, it will subtract karma from perl if it is greater than a randomin number between -1000 and -500.
docker pull busybox42/karmabot
docker run -it --restart=always --name karmabot -d -e TOKEN=<Legacy Slack Token> -e CHANNEL=<channel id> busybox42/karmabot
Build manually if you want to moify the karmabot.rb and/or if you want to run in kubernetes.
git clone https://github.com/busybox42/karmabot.git
cd karmabot
docker build -t karmabot .
To run in kubernetes first manually build the image.
After the image is built you can either run this command with your slack legacy token, channel id:
kubectl run --image=karmabot karma-app --env="TOKEN=<Slack legacy token>" --env="CHANNEL=<channel id>" --image-pull-policy=Never --replicas=1
or modify the karma-app.yaml file adding your legacy token and channel id:
kubectl apply -f karma-app.yaml
Because who doesn't want to scale their trolling?
kubectl scale deployment karma-app --replicas=3