我正在使用 slack_bolt 并尝试根据块元素中的 static_select 做出不同的响应。如何打印 selected_option 的值?
块是这样的
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Pick an item from the dropdown list"
},
"accessory": {
"type": "static_select",
"placeholder": {
"type": "plain_text",
"text": "Select an item",
"emoji": True
},
"options": [
{
"text": {
"type": "plain_text",
"text": "value-0",
"emoji": True
},
"value": "value-0"
}, ....
在这种情况下,我如何在选择一个选项后打印我选择的 value("value-0")?
我需要使用哪些变量?带吹气功能
@app.message("hello")
def show_event(event, say):
say(
blocks=blocks,
text="Pick a date for me to remind you"
)
@app.action("select_action")
def handle_some_action(ack, body, logger, say):
ack()
logger.info(body)
say(***"the variable to return selected value"***)