lbry.tech/app/helpers/slack.js
ポール ウェッブ b1a5c11ddf Refactor in progress
2018-08-28 18:57:18 -05:00

30 lines
535 B
JavaScript

"use strict"; require("dotenv").config();
// V A R I A B L E S
let Slack;
let slack;
if (typeof process.env.SLACK_WEBHOOK_URL !== "undefined") {
Slack = require("slack-node");
slack = new Slack();
slack.setWebhook(process.env.SLACK_WEBHOOK_URL);
}
// P R O G R A M
module.exports = exports = text => {
if (typeof slack === "undefined") return;
slack.webhook({
channel: "dottech-errors",
username: "lbrytech-bot",
text: text
}, (err, response) => { // eslint-disable-line
// do nothing?
});
};