Skip to content

Instantly share code, notes, and snippets.

@adover
Last active May 8, 2018 23:44
Show Gist options
  • Save adover/09ce53e5107238caeee0c416c58d9540 to your computer and use it in GitHub Desktop.
Save adover/09ce53e5107238caeee0c416c58d9540 to your computer and use it in GitHub Desktop.
const Slack = require('slack-node');
const config = require('../config/config.json');
const slack = new Slack();
slack.setWebhook(config.slack);
class SlackController {
sendMessage(message) {
slack.webhook({
channel: '#integration_logging',
username: 'integrationBot',
text: `${message}\n------------------`,
}, (err, res) => {
// console.log(res);
});
}
}
module.exports = new SlackController();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment