X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=turbot%2Fblocks.py;h=c037b03217f0ed117b823dc2141dfe03d05a6297;hb=4b3efe6fde2dd926f5b54eb357ed732e9e04d9e0;hp=cfef7f6a76ecf481224043d5a52b41565f46280b;hpb=10dd20653d14706cc1c7689745f8bcd80c29fa2b;p=turbot diff --git a/turbot/blocks.py b/turbot/blocks.py index cfef7f6..c037b03 100644 --- a/turbot/blocks.py +++ b/turbot/blocks.py @@ -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,