|
|
@@ -14,8 +14,18 @@ class BoltReciever {
|
|
|
return res.send(req.body);
|
|
|
}
|
|
|
|
|
|
+ const payload = req.body.payload;
|
|
|
+ let reqBody;
|
|
|
+
|
|
|
+ if (payload != null) {
|
|
|
+ reqBody = JSON.parse(payload);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ reqBody = req.body;
|
|
|
+ }
|
|
|
+
|
|
|
const event = {
|
|
|
- body: req.body,
|
|
|
+ body: reqBody,
|
|
|
ack: (response) => {
|
|
|
if (ackCalled) {
|
|
|
return;
|
|
|
@@ -104,6 +114,11 @@ class BoltService {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ this.bolt.action('button_click', async({ body, ack, say }) => {
|
|
|
+ await ack();
|
|
|
+ await say('clicked the button');
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
notCommand(command) {
|
|
|
@@ -169,6 +184,7 @@ class BoltService {
|
|
|
text: '検索結果をこのチャンネルに共有する',
|
|
|
},
|
|
|
style: 'primary',
|
|
|
+ action_id: 'button_click',
|
|
|
},
|
|
|
],
|
|
|
},
|