Skip to content

tonster/karmabot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Karmabot

Slack bot for trolling karma.

What? Why?

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.

Running in Docker

docker pull busybox42/karmabot
docker run -it --restart=always --name karmabot -d -e TOKEN=<Legacy Slack Token> -e CHANNEL=<channel id> busybox42/karmabot

Building Manually

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 .

Running with Kubernetes

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

Scaling in Kubernetes

Because who doesn't want to scale their trolling?

kubectl scale deployment karma-app --replicas=3 

About

Slack bot for trolling karma.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 90.1%
  • Dockerfile 6.1%
  • Makefile 3.8%