Skip to content

Instantly share code, notes, and snippets.

@alvareztech
Created June 11, 2016 05:48
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 alvareztech/61b37ea11a7a75d12ca44586973310d8 to your computer and use it in GitHub Desktop.
Save alvareztech/61b37ea11a7a75d12ca44586973310d8 to your computer and use it in GitHub Desktop.
Codelab: Mi primer bot para Slack. Modificación 1.
var Botkit = require('botkit')
var controller = Botkit.slackbot({debug: false})
controller
.spawn({
token: 'your-slack-token' // Edit this line!
})
.startRTM(function (err) {
if (err) {
throw new Error(err)
}
})
controller.hears(
['hola'], ['direct_message', 'direct_mention', 'mention'],
function (bot, message) { bot.reply(message, 'Miauuu. :smile_cat:') })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment