我试图显示谁点击了“是”,谁点击了“否”。这是我的代码。
"channel": SLACK_CHANNEL,
"text": "Would you like to promote the build to production?",
"attachments": [
{
"text": "Yes to deploy your build to production",
"fallback": "You are unable to promote a build",
"callback_id": "Put the callback_id for the action",
"color": "#SomeColourHere",
"attachment_type": "default",
"actions": [
{
"name": "deployment",
"text": "Yes",
"style": "danger",
"type": "button",
"value": json.dumps({"approve": True, "codePipelineToken": token, "codePipelineName": codepipeline_name}),
"confirm": {
"title": "Are you sure?",
"text": "This will deploy the build to production",
"ok_text": "Yes",
"dismiss_text": "No"
}
},
{
"name": "deployment",
"text": "No",
"type": "button",
"value": json.dumps({"approve": False, "codePipelineToken": token, "codePipelineName": codepipeline_name})
}
]
}
] 有没有办法让我们知道谁点击了这些按钮。
发布于 2021-07-02 00:45:46
您提供的详细信息不够详细,但我可以确认您可以找出是谁点击了这些按钮。
从外观上看,这段代码似乎是遗留下来的。Slack建议现在使用块工具包来构建交互式消息。
对于您的解决方案,当您捕获由按钮单击引发的事件时,'user‘详细信息将作为有效负载的一部分发送。
有关详情,请查看此处:https://api.slack.com/legacy/interactive-messages
https://stackoverflow.com/questions/68210205
复制相似问题