Skip to content

Instantly share code, notes, and snippets.

@KeesCBakker
Created August 10, 2018 11:44
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 KeesCBakker/012f01db0ce5c304b1b264e9ab353250 to your computer and use it in GitHub Desktop.
Save KeesCBakker/012f01db0ce5c304b1b264e9ab353250 to your computer and use it in GitHub Desktop.
Todo Add - Hubot Command Mapper
const { mapper, RestParameter } = require('hubot-command-mapper')
module.exports = robot => {
let todos = []
mapper(robot, {
name: 'todo',
commands: [{
name: 'add',
alias: [''],
parameters: [new RestParameter('item')],
invoke: (tool, robot, res, match, values) => {
const item = values.item
todos.push(item)
res.reply(`Added _${item}_ to the list.`)
}
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment