Skip to content

Instantly share code, notes, and snippets.

@deckerego deckerego/slack.js
Created Sep 14, 2018

What would you like to do?
Send a Message to Slack
'use strict';
const https = require('https');
class Slack {
constructor(slackPath) {
this._options = {
hostname: "",
method: "POST",
path: slackPath,
sendSlack(message) {
const payload = JSON.stringify({
text: message,
const req = https.request(this._options);
req.on("error", (error) => console.log("Error in sending Slack message: ", JSON.stringify(error)));
module.exports = Slack;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.