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

Commit

Permalink
Normalize block_actions from home and modal surfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansydnor committed Oct 27, 2019
1 parent 3eb56e7 commit e4a8d5f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/SlackBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,13 @@ function Slackbot(configuration) {

// normalize fields to match the rtm message format
message.user = message.user.id;
message.channel = message.channel.id;

// home and modal surfaces don't have channel IDs
if ((message.view && (message.view.type === 'home' || message.view.type === 'modal'))) {
message.channel = {};
} else {
message.channel = message.channel.id;
}

// move the first action's value into text field
// this allows conversations to "hear" the action value
Expand Down

0 comments on commit e4a8d5f

Please sign in to comment.