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

Make Interactive Slack Menus Work - fixes for #768 #769

Closed
wants to merge 1 commit into from
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
10 changes: 10 additions & 0 deletions lib/Slackbot_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,16 @@ module.exports = function(botkit, config) {

var direct_mention = new RegExp('^\<\@' + bot.identity.id + '\>', 'i');

if( message.actions ) {

try {
message.text = message.actions[0].selected_options[0].value;
} catch(e) {
botkit.debug('ERROR GETTING VALUE FROM SELECT');
}

}

message.text = message.text.replace(direct_mention, '')
.replace(/^\s+/, '').replace(/^\:\s+/, '').replace(/^\s+/, '');

Expand Down