]> git.cworth.org Git - turbot/blobdiff - turbot/blocks.py
Wire up a function to handle the edit_puzzle button
[turbot] / turbot / blocks.py
index cfef7f6a76ecf481224043d5a52b41565f46280b..c037b03217f0ed117b823dc2141dfe03d05a6297 100644 (file)
@@ -23,8 +23,9 @@ def actions_block(*elements):
         "elements": list(elements)
     }
 
-def button_block(label, name):
-    return {
+def button_block(label, name, extra=None):
+
+    block = {
         "type": "button",
         "text": {
             "type": "plain_text",
@@ -34,6 +35,11 @@ def button_block(label, name):
         "value": name
     }
 
+    if extra:
+        block['action_id'] = extra
+
+    return block
+
 def accessory_block(main, accessory):
     return {
         **main,