This is a Hubot plugin with two functions:
Create the NPM dependency:
$ npm install hubot-tangocard-highfive --save
And tell Hubot to load it on startup by modifying your external-scripts.json
to look something like this:
[
"some-plugin",
"hubot-tangocard-highfive",
"some-other-plugin"
]
Run this command in a chat room:
hubot highfive @john for nailing that design
Hubot will then send a message to the current room (or a configurable public room, see below) with congratulations and a nice GIF. If configured properly, this command will additionally trigger a gift card to be sent to the high-fived user:
hubot highfive @jane $25 for landing that huge account
First, set up HUBOT_HOSTNAME
to a URL where your hubot can be reached via https. Then run:
hubot highfive config
Hubot will give you a link to the configuration page, where a form will help walk you through all the environment variables you need/want to set.
When you're done filling out the form (and optionally submitting the credit-card information), copy the contents of the text area at the bottom, and paste them into a heroku config
or export
command-line, so all the values become part of Hubot's environment.
The basic high-five configuration consists of just three options:
HUBOT_HIGHFIVE_EMAIL_SERVICE
) helps the plugin figure out how to find the right room to send messages to, and how to format messages properly. If this is set to slack
, you'll also need to configure HUBOT_SLACK_API_TOKEN
.HUBOT_HIGHFIVE_ROOM
) sets the room in which high-fives are announced. If it's empty, the plugin will just spit messages out to the room it's triggered in.HUBOT_HIGHFIVE_ALLOW_EAVESDROPPING
) to notice a highfive @user...
even when Hubot itself isn't directly asked to do the highfive.You can add some custom GIFs by specifying HUBOT_HIGHFIVE_GIFS
to be a set of URLs separated by spaces.
The plugin also has the ability to automatically order gift cards from Tango Card and send them to the target user's email address. To access the Tango Card API, you'll have to go to their information page and click the "Get More Information" button at the bottom.
Once you've done that, you'll need to tell the plugin some values:
HUBOT_HIGHFIVE_AWARD_LIMIT
) sets an upper bound on the size of gift card that can be sent. The default is $150.HUBOT_HIGHFIVE_DAILY_LIMIT
) sets a limit on how much any single user can give out in a day. The default is $500.HUBOT_TANGOCARD_SKU
) configures which type of gift card you want to send to your team (defaults to an Amazon card if not set.) You can see the complete list at https://sandbox.tangocard.com/raas/v1/rewardsHUBOT_TANGOCARD_ROOTURL
) lets you use the sandbox API for testing (it's at https://sandbox.tangocard.com/raas/v1/). The default is the production endpoint.HUBOT_TANGOCARD_USER
) and a secret key (HUBOT_TANGOCARD_KEY
).HUBOT_TANGOCARD_CUSTOMER
and HUBOT_TANGOCARD_ACCOUNT
) are fairly arbitrary, and only really exist so you can track expenses through Tango Card. This plugin will use the same values for every card it orders.HUBOT_TANGOCARD_CC
) and record the auth code from the card (HUBOT_TANGOCARD_AUTH
) and the account email address (HUBOT_TANGOCARD_EMAIL
). Note that you have to click the "Process" button to generate a credit-card token.The plugin will automatically log gift cards to a Google Spreadsheet. To make this happen, do this:
.p12
key file to your computer. Run the following command to convert it to a PEM file:openssl pkcs12 -in downloaded-key-file.p12 -out your-key-file.pem -nodes
https://docs.google.com/…/spreadsheets/d/<SHEET_ID>/…
), and plug that into the highfive config form.This will set the following environment variables:
HUBOT_HIGHFIVE_SHEET_EMAIL
HUBOT_HIGHFIVE_SHEET_KEY
HUBOT_HIGHFIVE_SHEET_DOCID
HUBOT_HIGHFIVE_SHEET_SHEETNAME