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

Commit e4a8d5f

Browse files
committed
Normalize block_actions from home and modal surfaces
1 parent 3eb56e7 commit e4a8d5f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/SlackBot.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,13 @@ function Slackbot(configuration) {
565565

566566
// normalize fields to match the rtm message format
567567
message.user = message.user.id;
568-
message.channel = message.channel.id;
568+
569+
// home and modal surfaces don't have channel IDs
570+
if ((message.view && (message.view.type === 'home' || message.view.type === 'modal'))) {
571+
message.channel = {};
572+
} else {
573+
message.channel = message.channel.id;
574+
}
569575

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

0 commit comments

Comments
 (0)