A basic karma bot for Slack. This is basically a Slack bot to track karma using a REDIS database as a storage system.
Let's say slack pings the program with a message.
- app.js recieves the message
- app.js redirects it to karmabot.js
- karmabot.js processes the message and spits back a return message.
- To up vote: @xephos++
- To down vote: @xephos--
- To check karma: karma value @xephos
This function processes the message sent from the Slack outgoing webhooks.
This function takes the botPrePayload created in module.exports and sends it out as a response to Slack.
This processes the input from the if statement when the text is for karma value.
This processes the input from the if statement when the text is from a vote.
This votes for or against someone based off of the msg inserted.
This is used to check if something is a vote message within module.exports.
This is used to check if something is a karma value message within module.exports. This is also used to return the karma value of an item.
This just a simple function to pass from processVoteMessage to addValue.
This hits the REDIS server and adds or subtracts the value.