松弛不提供互动的原始信息
slack not providing original message on interaction
我正在使用此 JSON 响应传入的 Slack 斜杠命令(收到后不是 POST):
{
"text": "Testing some interactions!",
"attachments": [{
"callback_id": "testing_interactions",
"attachment_type": "default",
"actions": [{
"name": "action",
"text": "Click Me",
"value": "clicked",
"style": "primary",
"type": "button"
}]
}]
}
这给了我一个很好的、漂亮的、绿色的按钮来点击,大部分情况下一切看起来都很好;但是,根据 the Slack documentation for Interactive Messages,我应该在交互负载中得到一个 original_message
属性。
这不会发生,我只得到一个样本 POST,其有效负载如下:
{
"type": "interactive_message",
"actions": [
{
"name": "action",
"type": "button",
"value": "clicked"
}
],
"callback_id": "testing_interactions",
"team": {
"id": "TEAMID",
"domain": "mydomain"
},
"channel": {
"id": "CHANNELID",
"name": "directmessage"
},
"user": {
"id": "USERID",
"name": "me"
},
"action_ts": "123456",
"message_ts": "123456",
"attachment_id": "1",
"token": "my_token",
"is_app_unfurl": false,
"response_url": "https://hooks.slack.com/actions/...",
"trigger_id": "some.id"
}
我希望 original_message
属性 能够在我的目标实现中提供 approve/cancel 操作,但我做不到。
所以两个问题:
- 我缺少什么才能让
original_message
在互动时回发给我?
- 好像不对,但是是否需要保留原始数据以便轻松地重新创建消息?
您的互动消息是否是短暂的? From the docs: The original_message is not provided for ephemeral messages.
我正在使用此 JSON 响应传入的 Slack 斜杠命令(收到后不是 POST):
{
"text": "Testing some interactions!",
"attachments": [{
"callback_id": "testing_interactions",
"attachment_type": "default",
"actions": [{
"name": "action",
"text": "Click Me",
"value": "clicked",
"style": "primary",
"type": "button"
}]
}]
}
这给了我一个很好的、漂亮的、绿色的按钮来点击,大部分情况下一切看起来都很好;但是,根据 the Slack documentation for Interactive Messages,我应该在交互负载中得到一个 original_message
属性。
这不会发生,我只得到一个样本 POST,其有效负载如下:
{
"type": "interactive_message",
"actions": [
{
"name": "action",
"type": "button",
"value": "clicked"
}
],
"callback_id": "testing_interactions",
"team": {
"id": "TEAMID",
"domain": "mydomain"
},
"channel": {
"id": "CHANNELID",
"name": "directmessage"
},
"user": {
"id": "USERID",
"name": "me"
},
"action_ts": "123456",
"message_ts": "123456",
"attachment_id": "1",
"token": "my_token",
"is_app_unfurl": false,
"response_url": "https://hooks.slack.com/actions/...",
"trigger_id": "some.id"
}
我希望 original_message
属性 能够在我的目标实现中提供 approve/cancel 操作,但我做不到。
所以两个问题:
- 我缺少什么才能让
original_message
在互动时回发给我? - 好像不对,但是是否需要保留原始数据以便轻松地重新创建消息?
您的互动消息是否是短暂的? From the docs: The original_message is not provided for ephemeral messages.