浏览代码

add action method

kaori 5 年之前
父节点
当前提交
42558ec9eb
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/server/service/bolt.js

+ 7 - 0
src/server/service/bolt.js

@@ -104,6 +104,12 @@ class BoltService {
       }
     });
 
+    this.bolt.action('button_click', async({ body, ack, say }) => {
+      // Acknowledge the action
+      await ack();
+      await say('clicked the button');
+    });
+
   }
 
   notCommand(command) {
@@ -169,6 +175,7 @@ class BoltService {
                   text: '検索結果をこのチャンネルに共有する',
                 },
                 style: 'primary',
+                action_id: 'button_click',
               },
             ],
           },