Coder Social home page Coder Social logo

karmabot's Introduction

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 negative karma to perl with a random sleep between 5 and 20 minutes. As to not just keep adding karma once 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 random 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 modify 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 

karmabot's People

Contributors

busybox42 avatar tonster avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

tonster

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.