examples/slack-app/controller.js
function startRtm (token) {
  api.rtm.start(token, (err, bot) => {
    if (err) {
      return console.log(err)
    }

    bot.on(/hello/, (bot, message) => {
      bot.reply(message, 'GO CUBS')
    })

    bot.on(/howdy/, (bot, message) => {
      bot.reply(message, 'GO TRIBE')
    })
  })
}
function startRtm (token) {
  api.rtm.start(token, (err, bot) => {
    if (err) {
      return console.log(err)
    }

    bot.on(/hello/, (bot, message) => {
      bot.reply(message, 'GO CUBS')
    })

    bot.on(/howdy/, (bot, message) => {
      bot.reply(message, 'GO TRIBE')
    })
  })
}
function startRtm ( token ) { api . rtm . start ( token , ( err , bot ) => { if ( err ) { return console . log ( err ) } bot . on ( / hello / , ( bot , message ) => { bot . reply ( message , 'GO CUBS' ) } ) bot . on ( / howdy / , ( bot , message ) => { bot . reply ( message , 'GO TRIBE' ) } ) } ) }
starts the rtm connection
starts the rtm connection