Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.
/ KarmaBoi-PCF Public archive

A slack bot which integrates with PCF and tracks karma!

License

Notifications You must be signed in to change notification settings

tylarb/KarmaBoi-PCF

Repository files navigation

KarmaBoi

A bot which connects to slack to track karma! Grows a work community by tracking internet points persistently for users

Requirements and installation

First off, KarmaBoi needs a bot name and token provided as environment variables.

To deploy to cloud foundry, be sure a postgres sql instance is available and the service name is set correctly in dbopts.py, set user provided environment variables for SLACK_BOT_TOKEN and SLACK_BOT_NAME then push the app:

cf push KarmaBoi

The database tables will be configured automatically as long as a valid db instance is available.

Edit the command line of the manifest.yml to change the startup command.

KarmaBoi requires Python 3 and PyPI to be installed locally.

The default home location is ~/.KarmaBoi, and the database and logs will be placed there by default. Likewise, a bot_token file needs to be created in the home directory, in the following format:

name:My-Bot-Name
token:xoxb-My-Token

Just source the init.sh file and all requirements will be installed automatically.

source init.sh

KarmaBoi will run happily on Linux or MacOS. As the app runs persistently, it is recommended to use nohup and background the app using & to ensure that a lost terminal session doesn't kill the app.

nohup ./KarmaBoi/KarmaBoi.py&

Basic Usage

You can give any user or name karma by adding '++' to the end of the word:

screenshots/karmaup.png

Subtracting karma is just as simple - simply add '--':

screenshots/karmadown.png

The bot uses user IDs, so if a user's display name changes, their karma will remain.

There's a timer to prevent vote spam - karma can't be added or subtracked during this time:

screenshots/timer.png

You can also give name shame. Be intentional - shame cannot be decreased, it stays for the life of the user!

screenshots/shame.png

You can see full leaderboards by messaging the bot and give it one of the following commands: rank (for highest karma leaderboard), !rank (for lowest karma leaderboard), or ~rank (for shame leaderboard):

screenshots/rank.png

The bot also has a memory feature - you can tag any word using the keyword "is also":

screenshots/memoryset.png

and display what is remembered with the "keyword + ?". If a keyword has multiple inputs, the bot will choose a random one to display:

screenshots/memoryask.png

Additional information

Submit an issue or for any questions. I welcome contributions via pull requests as well.

Please check out new development of the bot in Golang: https://github.com/Tylarb/KarmaBoi-Go

License

Released under MIT license, copyright 2018 Tyler Ramer

About

A slack bot which integrates with PCF and tracks karma!

Resources

License

Stars

Watchers

Forks

Packages

No packages published