Last active
January 31, 2016 20:13
-
-
Save chrisbodhi/3db3d71533ce2d2eb2e7 to your computer and use it in GitHub Desktop.
Prepping Botkit for deployment to Heroku
This file contains 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
/*~~ Setup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ | |
if (!process.env.token) { | |
console.log('Error: Specify token in environment'); | |
process.exit(1); | |
} | |
const Botkit = require('../lib/Botkit.js'); | |
const port = process.env.PORT || 3000; | |
const controller = Botkit.slackbot({ | |
debug: true | |
}); | |
controller.setupWebserver(port, (err) => { | |
if (err) {console.error(err); } | |
console.log(`Hey d00d, webserver is on port ${port}...`); | |
}); | |
const bot = controller.spawn({ | |
token: process.env.token | |
}).startRTM(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment