Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Fix bot.replyPrivateDelayed. https://github.com/howdyai/botkit/issu… #446

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions lib/Slackbot_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,43 @@ module.exports = function(botkit, config) {
msg.channel = src.channel;

msg.response_type = 'ephemeral';
msg.replace_original = false;

var requestOptions = {
uri: src.response_url,
method: 'POST',
json: msg
};
request(requestOptions, function(err, resp, body) {
/**
* Do something?
*/
if (err) {
botkit.log.error('Error sending slash command response:', err);
cb && cb(err);
} else {
cb && cb();
}
});
}
};

bot.replyDelayedPrivate = function(src, resp, replace_original, cb) {
if (!src.response_url) {
cb && cb('No response_url found');
} else {
var msg = {};

if (typeof(resp) == 'string') {
msg.text = resp;
} else {
msg = resp;
}

msg.channel = src.channel;

msg.response_type = 'ephemeral';
msg.replace_original = replace_original;

var requestOptions = {
uri: src.response_url,
Expand Down