2017-06-16 104 views
4

使用鬆弛命令我想將一些消息菜單作爲附件。 那些需要動態填充,所以我註冊了一個選項負荷URL,並添加下列附件給我留言:無法選擇鬆弛動態消息菜單上的選項

[{ 
    "text": "Request's attributes", 
    "fallback": "Upgrade your Slack client to use message like these.", 
    "color": "#3AA3E3", 
    "attachment_type": "default", 
    "callback_id":"some ID", 
    "actions": [{ 
    "name": "priority_list", 
    "text": "Select a priority", 
    "type": "select", 
    "data_source": "external", 
    }, { 
     "name": "status_list", 
     "text": "Select a status", 
     "type": "select", 
     "data_source": "external", 
    }] 
    }] 

我選擇負載URL是正確的鬆弛調用,這裏是我的服務器響應:

{ 
    options: [{ 
     text: 'Low', 
     value: 'low' 
    }, 
    { 
     text: 'Medium', 
     value: 'medium' 
    }, 
    { 
     text: 'High', 
     value: 'high' 
    } 
], 
    selected_options: [{ 
    text: 'High', 
    value: 'high' 
}]} 

尋找鬆弛我可以看到選項是動態填充的。但是,他們都沒有被選中。

描述selected_options時我缺少一些東西?

回答

0

我認爲selected_options只能包含在原始的交互式消息請求中。這對我來說並沒有什麼意義,因爲你可以動態地生成選項,所以你不一定知道哪些是預先回來的,但是目前這是我得到它的唯一方法。