Closed bells17 closed 4 years ago
Thanks for this, and thanks for writing a test! I think if we want to go this route, it would be better to have a Webhook object or something, that can encode these options and have that call respond
instead of globally changing the channel settings. eg
wb = new slack.Webhook(options);
wb.respond("This is posted to #general")
@kevinburkeshyp Thanks for your feedback! I have added the following changes:
var Slack = require('slack-node');
var webhookUri = "__uri___";
var webhook = new Slack.Webhook({
url: webhookUri,
channel: "#general",
username: "webhookbot",
});
// only text
webhook.respond("This is posted to #general and comes from a bot named webhookbot.", function(err, response) {
console.log(response)
});
Can you review it? Thanks!
Add webhook default options
example: