💎 karmabot

Karmabot is a Slack Slash Command that candivvy out “Kᴀʀᴍᴀ” credits to users (and even take from them). Users can be added to and removed from the database via Karmabot itself using the commands laid out below.

info_outline About

Karmabot has an array of responses while performing commands, ranging from adding and removing Kᴀʀᴍᴀ from a user, to even adding a new user to the database. While performing Kᴀʀᴍᴀ based tasks, such as resetting or adding Kᴀʀᴍᴀ to a user’s balance, there is a small chance of a “rare” or “legendary” response. Currently the response options are an array, and the array has a random item selected from it.

Standard Kᴀʀᴍᴀ balance is denoted in backticks (grave symbol) when displayed, with the Gemstone unicode icon U+1F48E like so:

Alex 12:01 PM
/karmabot, give @alex +15 karma for being so awesome and programming you from the ground up.
💎
Karmabot APP 12:01 PM
Sure thing!
@alex now has 💎1000

Karmabot stores all Kᴀʀᴍᴀ values in a database, which is configured in the /config/config.php file. The database format is currently as follows:

id users gender karma_received karma_given karma_available
0 @alex m 100 0 0
id 0
users @alex
gender m
karma_received 100
karma_given 0
karma_available 0

code Commands

Currently, I've set both /karmabot and /karmabot, as Slash Commands, since it feels more natural to invoke karmabot using proper speech which can include an immediate comma which breaks the command /karmabot. Below is a list of commands and arguments that karmabot knows and can parse.

build Getting Started

Bleeding Edge: cloud_download download the development source package.

Notes:

Server:

  1. After downloading the src, upload it to your server.
  2. Set up your database and place the information in /config/config.php (Note: Use the /config/config.sample.php as a template)

Slack:

  1. First you'll need to set up a Slack Slash Command.
  2. Go to
    https://
    .slack.com/apps/manage/custom-integrations
  3. Click on Add Configuration.
  4. For Command type /karmabot (I recommend making another configuration for /karmabot, as well)
  5. For URL use the url to your /karmabot.php file.
  6. Method should be set to POST.
  7. (Note: I've been using "-help" for options for the Usage Hint).
  8. Click Save Integration.

Usage:

  1. In Slack, use /karmabot followed by a command above.
  2. The command list will continue to be updated, check back to download new master branch sourcesm, or add your own commands!

access_time Planned Features