Skip to content

Instantly share code, notes, and snippets.

@kmoe
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmoe/d0134b7ae108d56704fd to your computer and use it in GitHub Desktop.
Save kmoe/d0134b7ae108d56704fd to your computer and use it in GitHub Desktop.
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