我正在构建并发送消息附件:
var zz = {
"text": "Would you like to play a game??",
"attachments": [
{
"text": "Choose a game to play",
"fallback": "You are unable to choose a game",
"callback_id": "wopr_game",
"color": "#3AA3E3",
"attachment_type": "default",
"actions": [
{
"name": "chess",
"text": "Chess",
"type": "button",
"value": "chess"
}
]
}
]
}
web.chat.postMessage(message.source.channel, '', zz);
带有按钮的消息在 Slack 上显示正常,但是当我点击一个按钮时,Slack 没有对我的本地 ngrok 或快速路由的 POST 响应:
app.post('/slackaction', function(req, res)
虽然其他消息可以正常发布到此路线。
点击按钮后,我从 Slack 看到此错误:
"Oh no, something went wrong. Please try that again"
Slack 交互式消息request_url
设置为:
https://xxx.ngrok.io/slackaction