Slack 互动消息,点击按钮或菜单打开 link
Slack interactive message, click on button or menu to open a link
我的邮件附件上有一个暂停 select 按钮。
actions: [
{
name: 'snoozeTime',
text: 'Select a time...',
type: 'select',
options: [
{
text: '1 Hour',
value: '1hour'
},
{
text: '4 Hours',
value: '4'
},
{
text: '24 Hours',
value: '24hours'
},
{
text: 'Custom',
value: 'custom'
}
]
}
]
我想将用户重定向到我的网页以选择自定义暂停时间。请告诉我如何实现它?
谢谢
Slack 不支持自动重定向到第 3 方网站。几周前我与 Slack 支持人员讨论了这个功能,他们说他们在内部讨论过,但出于安全考虑目前不会支持它。
您目前唯一的选择(也是我为我的应用程序选择的一个,例如 Rafflebot)是向用户显示自定义 link(作为 slack 消息或附件的一部分),用户必须单击然后打开您的网站。这有点难看,但它有效。
或者您可以等待 Slack 承诺实现的即将推出的 "input box" 功能。您可以在 Slack Platform Roadmap 的 "Interactive message stage 3" 下找到它。我不知道任何时间表,但它被标记为 "Near term".
对了,现在slack平台已经支持了。 Slack Link Buttons
{
"text": "<@W1A2BC3DD> approved your travel request. Book any airline you like by continuing below.",
"channel": "C061EG9SL",
"attachments": [
{
"fallback": "Book your flights at https://flights.example.com/book/r123456",
"actions": [
{
"type": "button",
"name": "travel_request_123456",
"text": "Book flights ",
"url": "https://flights.example.com/book/r123456",
"style": "primary"
},
{
"type": "button",
"name": "travel_cancel_123456",
"text": "Cancel travel request",
"url": "https://requests.example.com/cancel/r123456",
"style": "danger"
}
]
}
]
}
我的邮件附件上有一个暂停 select 按钮。
actions: [
{
name: 'snoozeTime',
text: 'Select a time...',
type: 'select',
options: [
{
text: '1 Hour',
value: '1hour'
},
{
text: '4 Hours',
value: '4'
},
{
text: '24 Hours',
value: '24hours'
},
{
text: 'Custom',
value: 'custom'
}
]
}
]
我想将用户重定向到我的网页以选择自定义暂停时间。请告诉我如何实现它?
谢谢
Slack 不支持自动重定向到第 3 方网站。几周前我与 Slack 支持人员讨论了这个功能,他们说他们在内部讨论过,但出于安全考虑目前不会支持它。
您目前唯一的选择(也是我为我的应用程序选择的一个,例如 Rafflebot)是向用户显示自定义 link(作为 slack 消息或附件的一部分),用户必须单击然后打开您的网站。这有点难看,但它有效。
或者您可以等待 Slack 承诺实现的即将推出的 "input box" 功能。您可以在 Slack Platform Roadmap 的 "Interactive message stage 3" 下找到它。我不知道任何时间表,但它被标记为 "Near term".
对了,现在slack平台已经支持了。 Slack Link Buttons
{
"text": "<@W1A2BC3DD> approved your travel request. Book any airline you like by continuing below.",
"channel": "C061EG9SL",
"attachments": [
{
"fallback": "Book your flights at https://flights.example.com/book/r123456",
"actions": [
{
"type": "button",
"name": "travel_request_123456",
"text": "Book flights ",
"url": "https://flights.example.com/book/r123456",
"style": "primary"
},
{
"type": "button",
"name": "travel_cancel_123456",
"text": "Cancel travel request",
"url": "https://requests.example.com/cancel/r123456",
"style": "danger"
}
]
}
]
}