与Slack Block Kit模态框交互时未收到block_action负载
Slack紧急事务处理Bot模态框交互无Payload问题
我正在开发一款处理团队紧急事务的Slack Bot,此前所有配置存储在JSON文件中,现在需要增强其交互性。之前因邮件风暴导致Bot被反复触发,所以先给Bot添加「Snooze」按钮替代终止进程的操作。
已成功调出模态框,UI显示正常,但点击提交后收不到任何payload数据:
- 预期Flask应用会收到包含交互payload的POST请求,但处理多数Slack交互的根路径「/」、关联Slash Command的「/911_snooze」端点均未收到请求
- 界面同时出现警告三角错误(见配图)
以下是模态框的Block Kit配置JSON(由Block Kit Builder生成后手动调整,下拉选项从外部列表程序化生成,Builder未检测到错误):
{ "title": { "type": "plain_text", "text": "911 Snooze Alerts", "emoji": true }, "submit": { "type": "plain_text", "text": "Submit", "emoji": true }, "type": "modal", "callback_id": "snooze_911_alerts", "close": { "type": "plain_text", "text": "Cancel", "emoji": true }, "blocks": [ { "type": "divider" }, { "type": "section", "text": { "type": "mrkdwn", "text": "Application to Snooze" }, "accessory": { "type": "static_select", "placeholder": { "type": "plain_text", "text": "Application", "emoji": true }, "options": [ { "text": { "type": "plain_text", "text": "APP1", "emoji": true }, "value": "BOE" }, { "text": { "type": "plain_text", "text": "APP2", "emoji": true }, "value": "IBOE" }, { "text": { "type": "plain_text", "text": "APP3", "emoji": true }, "value": "GBOE" }, { "text": { "type": "plain_text", "text": "APP4", "emoji": true }, "value": "Swift" } ], "action_id": "application_select_action" } }, { "type": "section", "text": { "type": "mrkdwn", "text": "How long do you want to snooze for:" }, "accessory": { "type": "radio_buttons", "options": [ { "text": { "type": "plain_text", "text": "5 minutes", "emoji": true }, "value": "minutes-5" }, { "text": { "type": "plain_text", "text": "30 minutes", "emoji": true }, "value": "minutes-30" }, { "text": { "type": "plain_text", "text": "60 minutes", "emoji": true }, "value": "minutes-60" }, { "text": { "type": "plain_text", "text": "90 minutes", "emoji": true }, "value": "minutes-90" } ], "action_id": "radio_buttons-action" } } ] }
内容的提问来源于stack exchange,提问作者Timothy Grant
相关产品推荐
相关产品推荐

