diff --git a/flow/slack_connector.js b/flow/slack_connector.js index b0be352..ba8638a 100644 --- a/flow/slack_connector.js +++ b/flow/slack_connector.js @@ -8,7 +8,7 @@ exports.output = 1; exports.click = false; exports.author = 'Jakub Klena'; exports.icon = 'sign-out'; -exports.options = { slack_channel: "C071KN2Q8SK", bot_name: "Flow DEMO", bot_icon: ":totaljs:" }; +exports.options = { slack_channel: "C071KN2Q8SK", api_key: "", bot_name: "Flow DEMO", bot_icon: ":totaljs:" }; // Slack channel - where to post the messages, can be name like "backend-alerts" // Bot Name - Name of the "user" that will post these messages, it should be based on which server it is running on. // Bot Icon - We can use any slack icon (even custom ones uploaded by us) as the "user" profile picture @@ -19,6 +19,11 @@ exports.html = `
Slack Channel
+
+
+
API Key:
+
+
Bot Name
@@ -69,17 +74,14 @@ exports.install = function(instance) { }`; let headers = { 'Content-type': `application/json`, - 'Authorization': `Bearer xoxb-7060441089557-7144902656932-7IU6yMlvscrNtm5KrZxbm7Tf` + 'Authorization': `Bearer ${instance.options.api_key}` }; if (F.is4) { let opt = { 'method': 'post', 'url': 'https://slack.com/api/chat.postMessage', - 'headers': { - 'Content-type': `application/json`, - 'Authorization': `Bearer xoxb-7060441089557-7144902656932-7IU6yMlvscrNtm5KrZxbm7Tf` - }, + 'headers': headers, 'cookies': null, 'body': JSON.stringify(message), 'type': 'json',