Last active
August 29, 2015 14:27
-
-
Save kmoe/d0134b7ae108d56704fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module['exports'] = function kahootDeskbeers(hook) { | |
// Usage: | |
// /deskbeers balance - gets your balance | |
// /deskbeers drink [number] - records that you drank [number] beers | |
// /deskbeers pay [amount] - records that you paid the pig/George £[amount] | |
var DESKBEERS_ADMIN_USERNAME = 'george'; | |
var USAGE = 'Usage: `/deskbeers balance` to get your balance, `/deskbeers drink [number]` to record that you drank [number] beers, `/deskbeers pay [amount]` to record that you paid £[amount] to George or the pig.'; | |
console.log(hook.params); | |
var slashCommandParams = hook.params.text.split(' '); | |
if (slashCommandParams[0] === '' || slashCommandParams.length > 2 || slashCommandParams[0] === 'help') { | |
hook.res.end(USAGE); | |
} | |
if (slashCommandParams[0] === 'balance') { | |
hook.res.end('get balance'); | |
} | |
console.log(slashCommandParams); | |
hook.res.end('deskbeers testing'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment